Setting the Db2 schema in a JVM server

You can set the current Db2® schema for a JVM server that accesses Db2. The default Db2 schema is set to the current user ID.

Modifying the Db2 schema for a JVM server

The db2.jcc.currentSchema property sets the Db2 schema for a JVM server.

Figure 1. Setting the Db2 schema to CICSDB2 in a JVM profile
-Ddb2.jcc.currentSchema=CICSDB2

Db2 schema can be used for all JVM server types.

Modifying the Db2 schema in a Liberty data source

The dataSource configuration element in server.xml of a Liberty JVM server configures the Db2 data source. One of the Liberty JDBC features, jdbc-4.0, jdbc-4.1, jdbc-4.2, or jdbc-4.3, must be installed in the Liberty JVM server.

Figure 2. Setting the Db2 schema to CICSDB2 in the dataSource element in server.xml
<dataSource id="cicsdb2" jndiName="jdbc/cicsdb2">
    <jdbcDriver libraryRef="db2Lib"/>
    <properties.db2.jcc currentSchema="CICSDB2"/>
</dataSource>

The data source configuration overrides the db2.jcc.currentSchema property.

Modifying the Db2 schema in the CICS data source

The cicsts_dataSource configuration element in server.xml of a Liberty JVM server configures the Db2 data source. The CICS® JDBC feature cicsts:jdbc-1.0 must be installed in the Liberty server.

Setting the allowautoconfigure attribute to false in the cicsts_dataSource element allows you to modify the data source without CICS modifying the element.

Figure 3. Setting the Db2 schema to CICSDB2 in the dataSource element in server.xml
<cicsts_dataSource allowautoconfigure="false" 
    id="defaultCICSDataSource" jndiName="jdbc/defaultCICSDataSource">
    <properties.db2.jcc currentSchema="CICSDB2"/>
</cicsts_dataSource>

The data source configuration overrides the db2.jcc.currentSchema property.