Data source minimum required settings for DB2
- DB2 Using IBM JCC Driver
- DB2 Using IBM JCC Driver (XA)
- DB2 Universal JDBC Driver provider
- DB2 Universal JDBC Driver provider (XA)
DB2 Using IBM JCC Driver
One-phase commit JCC provider for DB2 that uses the IBM Data Server Driver for JDBC and SQLJ. The DB2 Using IBM JCC Driver is the next generation of the DB2 Universal JCC driver. Data sources you create under this provider support only 1-phase commit processing, unless you use the type 2 JDBC driver with the appserver for z/OS. If we run the appserver on z/OS with the type 2 driver, the driver uses RRS and supports 2-phase commit processing.
This provider:
- Is configurable only in version 7.0 and later nodes
- Supports the following one-phase data source:
com.ibm.db2.jcc.DB2ConnectionPoolDataSource- Requires the following JDBC driver files:
- db2jcc4.jar
After you install DB2, we can find this .jar file in the DB2 java directory. For Type 4 JDBC driver support from a client machine where DB2 is not installed, copy this file to the local machine. If we install any fixes or upgrades to DB2, update this file as well. You must also set the UNIVERSAL_JDBC_DRIVER_PATH path variable to point to the db2jcc4.jar file.
- db2jcc_license_cu.jar
DB2 Universal JDBC driver license file that allows access to the DB2 Universal database. Use this .jar file or the next one to gain access to the database. This .jar file ships with the application server in a directory that is defined by the ${UNIVERSAL_JDBC_DRIVER_PATH} environment variable.
- db2jcc_license_cisuz.jar
DB2 Universal JDBC driver license file that allows access to the following databases:
- DB2 Universal
- DB2 for iSeries
- DB2 for z/OS
- SQLDS
db2jcc_license_cisuz.jar does not ship with the appserver. Place this file in the same directory as the db2jcc4.jar file, so that UNIVERSAL_JDBC_DRIVER_PATH points to both files.
- Uses the following class paths:
${DB2_JCC_DRIVER_PATH}/db2jcc4.jar ${UNIVERSAL_JDBC_DRIVER_PATH}/db2jcc_license_cu.jar ${DB2_JCC_DRIVER_PATH}/db2jcc_license_cisuz.jar- Requires the following DataStoreHelper class:
com.ibm.websphere.rsadapter.DB2UniversalDataStoreHelper- Requires a valid authentication alias.
- Requires properties:
- databaseName
Actual database name if the driverType is set to 4, or a locally cataloged database name if the driverType is set to 2.
- driverType
The JDBC connectivity type of a data source. There are two permitted values: 2 and 4. To use the type 2 driver, set this value to 2. To use Universal JDBC Driver type 4, set this value to 4.
- serverName
The TCP/IP address or host name for the Distributed Relational Database Architecture (DRDA) server. Provide a value for this property only if the driverType is set to 4. Is not required if the driverType is set to 2.
- portNumber
The TCP/IP port number where the DRDA server resides. Provide a value for this property only if the driverType is set to 4.
Is not required if the driverType is set to 2.
- useTransactionRedirect
Set this property as a data source custom property if the backend uses the Database Partitioning Feature (DPF) of DB2 UDB V8.2, fix pack 10, and the partitioning key remains constant throughout a transaction. Activating the property affects how the DB2 Universal JDBC Driver directs each connection request that begins a transaction with DB2. The JDBC driver is triggered to send those connection requests to the DPF node that contains the target data of the first directable statement in the transaction, if such a statement exists. DB2 then directs the SQL statement to different partitions as needed; the transaction proceeds normally from the viewpoint of the appserver.
You can use useTransactionRedirect for both driverType 2 and driverType 4 data sources. To configure the property, use either the wsadmin scripting tool or the admin console page, Java EE resource provider or connection factory custom properties collection. Assign the property the value of true.
DB2 Using IBM JCC Driver (XA)
The DB2 Using IBM JCC Driver (XA) is a two-phase commit JCC provider for DB2 that uses the IBM Data Server Driver for JDBC and SQLJ. The IBM Data Server Driver is the next generation of the DB2 Universal JCC driver. Data sources created under this provider support the use of XA to perform two-phase commit processing.
This provider:
- Is configurable in version 7.0 and later nodes.
- Supports the following two-phase data source:
com.ibm.db2.jcc.DB2XADataSource- Requires the following JDBC driver files:
- db2jcc4.jar
DB2 Universal JDBC Driver .jar file. After you install DB2, we can find this .jar file in the DB2 Java directory. For Type 4 JDBC driver support from a client machine where DB2 is not installed, copy this file to the local machine. If we install any fixes or upgrades to DB2, update this file as well. You must also specify the fully qualified path of db2jcc4.jar as the value of the UNIVERSAL_JDBC_DRIVER_PATH environment variable.
- db2jcc_license_cu.jar
License file that allows access to the DB2 Universal database. Use this .jar file or the next one to gain access to the database. This .jar file ships with the appserver in the APP_ROOT/universalDriver/lib directory.
- db2jcc_license_cisuz.jar
License file that allows access to the following databases:
- DB2 Universal
- DB2 for iSeries
- DB2 for z/OS
- SQLDS
Use the right license .jar file to access a specific database backend.
- The native files that are required by the DB2 Universal JDBC Driver in the application server.
- Uses the following class paths:
${DB2_JCC_DRIVER_PATH}/db2jcc4.jar
${UNIVERSAL_JDBC_DRIVER_PATH}/db2jcc_license_cu.jar
${DB2_JCC_DRIVER_PATH}/db2jcc_license_cisuz.jar
${DB2_JCC_DRIVER_NATIVEPATH}- Requires the following DataStoreHelper class:
com.ibm.websphere.rsadapter.DB2UniversalDataStoreHelper- Requires a valid authentication alias.
- Requires the following properties:
- databaseName
Actual database name if the driverType is set to 4, or a locally cataloged database name if the driverType is set to 2.
- driverType
The JDBC connectivity type of a data source. There are two permitted values: 2 and 4. To use the type 2 XA driver, set this value to 2. To use Universal JDBC Driver type 4 XA (which requires DB2 8.1 Fix Pack 7 or higher), set this value to 4.
- serverName
The TCP/IP address or host name for the Distributed Relational Database Architecture (DRDA) server. Provide a value for this property only if the driverType is set to 4. Is not required if the driverType is set to 2.
- portNumber
The TCP/IP port number where the DRDA server resides. Provide a value for this property only if the driverType is set to 4.
Is not required if the driverType is set to 2.
- useTransactionRedirect
Set this property as a data source custom property if the backend uses the Database Partitioning Feature (DPF) of DB2 UDB V8.2, fix pack 10, and the partitioning key remains constant throughout a transaction. Activating the property affects how the DB2 Universal JDBC Driver directs each connection request that begins a transaction with DB2. The JDBC driver is triggered to send those connection requests to the DPF node that contains the target data of the first directable statement in the transaction, if such a statement exists. DB2 then directs the SQL statement to different partitions as needed; the transaction proceeds normally from the viewpoint of the appserver.
We can use useTransactionRedirect for both driverType 2 and driverType 4 data sources. To configure the property, use either the wsadmin scripting tool or the admin console page, Java EE resource provider or connection factory custom properties collection. Assign the property the value of true.
DB2 Universal JDBC Driver provider
The DB2 Universal JDBC Driver is an architecture-neutral JDBC driver for distributed and local DB2 access. Because the Universal Driver architecture is independent of any particular JDBC driver connectivity or target platform, it allows both Java connectivity (Type 4) or JNI based connectivity (Type 2) in a single driver instance to DB2.
This provider:
- Allows applications to use both JDBC and Structured Query Language in Java (SQLJ) access.
- Supports the following one-phase data source:
com.ibm.db2.jcc.DB2ConnectionPoolDataSource- Requires the following JDBC driver files:
- db2jcc.jar
After you install DB2, we can find this .jar file in the DB2 java directory. For Type 4 JDBC driver support from a client machine where DB2 is not installed, copy this file to the local machine. If we install any fixes or upgrades to DB2, update this file as well. You must also set the DB2UNIVERSAL_JDBC_DRIVER_PATH path variable to point to the db2jcc.jar file.
- db2jcc_license_cu.jar
DB2 Universal JDBC driver license file that allows access to the DB2 Universal database. Use this .jar file or the next one to gain access to the database. This .jar file ships with the application server in a directory that is defined by the ${UNIVERSAL_JDBC_DRIVER_PATH} environment variable.
- db2jcc_license_cisuz.jar
DB2 Universal JDBC driver license file that allows access to the following databases:
- DB2 Universal
- DB2 for iSeries
- DB2 for z/OS
- SQLDS
db2jcc_license_cisuz.jar does not ship with the appserver. Place this file in the same directory as the db2jcc.jar file, so that the DB2UNIVERSAL_JDBC_DRIVER_PATH points to both.
- Uses the following class path:
${DB2UNIVERSAL_JDBC_DRIVER_PATH}/db2jcc.jar
${UNIVERSAL_JDBC_DRIVER_PATH}/db2jcc_license_cu.jar
${DB2UNIVERSAL_JDBC_DRIVER_PATH}/db2jcc_license_cisuz.jar- Requires the following DataStoreHelper class:
com.ibm.websphere.rsadapter.DB2UniversalDataStoreHelper- Requires a valid authentication alias.
- Requires the following properties:
- databaseName
Actual database name if the driverType is set to 4, or a locally cataloged database name if the driverType is set to 2.
- driverType
The JDBC connectivity type of a data source. There are two permitted values: 2 and 4. To use Universal JDBC Driver type 2, set this value to 2. To use Universal JDBC Driver type 4, set this value to 4.
- serverName
The TCP/IP address or host name for the Distributed Relational Database Architecture (DRDA) server. Provide a value for this property only if the driverType is set to 4. Is not required if the driverType is set to 2.
- portNumber
The TCP/IP port number where the DRDA server resides. Provide a value for this property only if the driverType is set to 4.
Is not required if the driverType is set to 2.
- useTransactionRedirect Set this property as a data source custom property if the backend uses the Database Partitioning Feature (DPF) of DB2 UDB Version 8.2, fix pack 10, and the partitioning key remains constant throughout a transaction. Activating the property affects how the DB2 Universal JDBC Driver directs each connection request that begins a transaction with DB2. The JDBC driver is triggered to send those connection requests to the DPF node that contains the target data of the first directable statement in the transaction, if such a statement exists. DB2 then directs the SQL statement to different partitions as needed; the transaction proceeds normally from the viewpoint of the appserver.
You can use useTransactionRedirect for both driverType 2 and driverType 4 data sources. To configure the property, use either the wsadmin scripting tool or the admin console page Java EE resource provider or connection factory custom properties collection. Assign the property the value of true.
DB2 Universal JDBC Driver provider (XA)
The DB2 Universal JDBC Driver provider (XA) is an architecture-neutral JDBC provider for distributed and local DB2 access.
Whether you use this provider for Java connectivity or JNI based connectivity depends on the version of DB2 we are running. Version 6.0 and later of the appserver requires DB2 8.1 Fix Pack 6.
This version of DB2 only supports XA connectivity over the JNI based connectivity (Type 2) driver. In order to use XA connectivity with the Type 4 driver, DB2 8.1 Fix Pack 7 or higher is required.
This provider:
- Allows applications to use both JDBC and SQLJ access.
- Supports the two phase data source:
com.ibm.db2.jcc.DB2XADataSource- Requires the following JDBC driver files:
- db2jcc.jar
DB2 Universal JDBC Driver .jar file. After you install DB2, we can find this .jar file in the DB2 Java directory. For Type 4 JDBC driver support from a client machine where DB2 is not installed, copy this file to the local machine.
If we install any fixes or upgrades to DB2, update this file as well. You must also specify the fully qualified path of db2jcc.jar as the value of the DB2UNIVERSAL_JDBC_DRIVER_PATH environment variable.
- db2jcc_license_cu.jar
DB2 Universal JDBC Driver license file that allows access to the DB2 Universal database. Use this .jar file or the next one to gain access to the database. This .jar file ships with the application server in the APP_ROOT/universalDriver/lib directory.
- db2jcc_license_cisuz.jar
DB2 Universal JDBC Driver license file that allows access to the following databases:
- DB2 Universal
- DB2 for iSeries
- DB2 for z/OS
- SQLDS
Use the right license .jar file to access a specific database backend.
- The native files required by the DB2 Universal JDBC Driver in the application server.
- Uses the following class path:
${DB2UNIVERSAL_JDBC_DRIVER_PATH}/db2jcc.jar
${UNIVERSAL_JDBC_DRIVER_PATH}/db2jcc_license_cu.jar
${DB2UNIVERSAL_JDBC_DRIVER_PATH}/db2jcc_license_cisuz.jar
${DB2UNIVERSAL_JDBC_DRIVER_NATIVEPATH}- Requires the following DataStoreHelper class:
com.ibm.websphere.rsadapter.DB2UniversalDataStoreHelper- Requires a valid authentication alias.
- Requires properties:
- databaseName
Actual database name if the driverType is set to 4, or a locally cataloged database name if the driverType is set to 2.
- driverType
The JDBC connectivity type of a data source. There are two permitted values: 2 and 4. To use Universal JDBC Driver type 2 XA, set this value to 2. To use Universal JDBC Driver type 4 XA (which requires DB2 8.1 Fix Pack 7 or higher), set this value to 4.
- serverName
The TCP/IP address or host name for the Distributed Relational Database Architecture (DRDA) server. Provide a value for this property only if the driverType is set to 4. Is not required if the driverType is set to 2.
- portNumber
The TCP/IP port number where the DRDA server resides. Provide a value for this property only if the driverType is set to 4.
Is not required if the driverType is set to 2.
- useTransactionRedirect
Set this property as a data source custom property if the backend uses the Database Partitioning Feature (DPF) of DB2 UDB V8.2, fix pack 10, and the partitioning key remains constant throughout a transaction. Activating the property affects how the DB2 Universal JDBC Driver directs each connection request that begins a transaction with DB2. The JDBC driver is triggered to send those connection requests to the DPF node that contains the target data of the first directable statement in the transaction, if such a statement exists. DB2 then directs the SQL statement to different partitions as needed; the transaction proceeds normally from the viewpoint of the appserver.
We can use useTransactionRedirect for both driverType 2 and driverType 4 data sources. To configure the property, use either the wsadmin scripting tool or the admin console page Java EE resource provider or connection factory custom properties collection. Assign the property the value of true.
HP-UX SafepointPolling
SafepointPolling technology in the HP JVM for HP-UX might interfere with DB2 transactions. Developed to ensure safepoints for Java threads, SafepointPolling technology generates a signal that can interfere with the signal between the application server and a DB2 database. Database deadlocks often result. Prevent the interference by starting the JVM with the -XX:-SafepointPolling option, which disables SafepointPolling during runtime.
32-bit vs. 64-bit
Starting with DB2 v9, Linux, HP-UX, and Solaris systems require a 64-bit kernel. In addition, the width of the default instance bit is now determined by the operating system, which is different than with previous versions of DB2. The -w option, which would have provided the ability to specify the bit width of the instance, was removed for the commands: db2icrt, db2ilist and db2iupdt.
These changes on Linux, HP-UX, and Solaris systems preclude the ability to create or maintain a 32-bit instance of the appserver with v9 of DB2 on UNIX platforms. On 64-bit UNIX systems that have a 32-bit instance created for v8 of DB2, migrate the 32-bit instance for v8 of DB2 to a 64-bit instance for version 8 of DB2 before you migrate the instance to version 9 of DB2.
Related tasks
Set a JDBC provider and data source
Set a JDBC provider
Set a data source
Create and configuring a JDBC provider and data source using the JMX API
Set new data source custom properties using scripting