DB2 Universal JDBC Driver provider The DB2 Universal
JDBC Driver is an architecture-neutral JDBC driver for distributed and local
DB2 access. Because the DB2 Universal Driver architecture is independent of
any particular JDBC driver connectivity or target platform, it allows both
Java connectivity (Type 4) or Java Native Interface (JNI) based connectivity
(Type 2) in a single driver instance to DB2. The DB2 Universal JDBC Driver
provider supports both JDBC and Structured Query Language in Java (SQLJ) access
to DB2 databases, as well as SQLJ use with CMP.
The DB2 Universal JDBC Driver
provider supports the data source:
com.ibm.db2.jcc.DB2ConnectionPoolDataSource
This
data source can support two-phase transactions (for Application Server on
the z/OS platform only). If you set the DB2 Universal JDBC Driver for type
2 connectivity, Application Server on z/OS uses RRS to process transactions,
including two-phase commit transactions. When used with driver type 4 connectivity,
this data source implementation supports one-phase transactions only.
The
provider requires JDBC driver files:
- db2jcc.jar This is the DB2 Universal JDBC Driver jar
file, which is located in the DB2 installation directory. Specify the fully-qualified
path of this jar file for the value of your WebSphere variable ${DB2UNIVERSAL_JDBC_DRIVER_PATH}.
For example:
<classpath>${DB2UNIVERSAL_JDBC_DRIVER_PATH}/db2jcc.jar </classpath>
Application
Server uses this value to define the JDBC provider.
- db2jcc_license_cisuz.jar This DB2 Universal JDBC Driver
license file is included with DB2. The installation program for DB2 places
the license file in the same DB2 directory as db2jcc.jar.
Therefore your variable ${DB2UNIVERSAL_JDBC_DRIVER_PATH} ultimately
points to both files.
Tip: The driver file db2jcc_license_cu.jar ships
with Application Server in the WAS_HOME/universalDriver/lib directory.
It is automatically set to the ${DB2UNIVERSAL_JDBC_DRIVER_PATH} variable.
Although this driver file does not provide access to DB2 for z/OS, you can
leave it as part of the variable definition.
- The native files of .so type are required by the DB2
Universal JDBC Driver in WebSphere Application Server for z/OS. Set the library
path variable ${DB2UNIVERSAL_JDBC_DRIVER_NATIVEPATH} to the
directory that contains the native files. (In cases that do not require native
files, set the DB2UNIVERSAL_JDBC_DRIVER_NATIVEPATH to null.)
The DB2 Universal JDBC Driver requires
DataStoreHelper class:
com.ibm.websphere.rsadapter.DB2UniversalDataStoreHelper
This driver also requires a valid authentication alias if the driverType
property (see properties below) is set to 4. If the driverType property is
set to 2, a component-managed authentication alias must be specified to use
the data source with res-auth APPLICATION. In the case where driverType 2
is specified and the data source is used with res-auth CONTAINER, you can
specify a container-managed authentication alias; however, it is not required.
If you do not specify a container-managed alias, the user identity associated
with a connection created by the data source will be the user identity associated
with the current thread at the time the connection is obtained.
It requires
the following properties:
- databaseName This is an 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. If you want to use Universal JDBC
Driver type 2 , set this value to 2. If you want 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 your driverType is set to 4. This property
is not required if your driverType is set to 2.
- portNumber The TCP/IP port number where the DRDA server resides.
Provide a value for this property only if your driverType is set to 4.
This property is not required if your driverType is set to 2.
Optional properties: DB2 supports additional
connection properties for the DB2 Universal JDBC Driver; set them as custom
properties on the data source. For information about these optional data
source properties, consult the Application Programming Guide and Reference
for Java for your version of DB2 for z/OS.
DB2 Universal JDBC Provider (XA) The XA DB2 Universal
JDBC provider uses the DB2 Universal JDBC Driver to provide access to DB2
databases. The Universal JDBC Driver supports Java communication-based connectivity
(driver Type 4). For XA transactions, driver type 2 connectivity is
not
supported by the DB2 Universal JDBC Driver on WebSphere Application Server
for z/OS.
Requirement: To use this provider,
you must have the DB2 Universal JDBC Driver for DB2 Version 7 or DB2 Version
8 installed and configured for WebSphere Application Server for z/OS, or you
must have the z/OS Application Connectivity to DB2 for z/OS feature installed
and configured for WebSphere Application Server for z/OS. Refer to the topic
Using the DB2 Universal JDBC Driver to access DB2 for z/OS.
The
DB2 Universal JDBC Driver provider (XA) allows applications to use both JDBC
and Structured Query Language in Java (SQLJ) access to DB2 databases. SQLJ
use with CMP is also supported.
This provider does not support the creation
of Version 4.0 data sources.
The DB2 Universal JDBC Driver provider
(XA) supports the two phase data source:
com.ibm.db2.jcc.DB2XADataSource
The provider requires JDBC driver files:
- db2jcc.jar This is the DB2 Universal JDBC Driver jar
file, which is located in the DB2 installation directory. Specify the fully-qualified
path of this jar file for the value of your WebSphere variable ${DB2UNIVERSAL_JDBC_DRIVER_PATH}.
For example:
<classpath>${DB2UNIVERSAL_JDBC_DRIVER_PATH}/db2jcc.jar </classpath>
Application
Server uses this value to define the JDBC provider.
- db2jcc_license_cisuz.jar This DB2 Universal JDBC Driver
license file is included with DB2. The installation program for DB2 places
the license file in the same DB2 directory as db2jcc.jar.
Therefore your variable ${DB2UNIVERSAL_JDBC_DRIVER_PATH} ultimately
points to both files.
Tip: The driver file db2jcc_license_cu.jar ships
with Application Server in the WAS_HOME/universalDriver/lib directory.
It is automatically set to the ${DB2UNIVERSAL_JDBC_DRIVER_PATH} variable.
Although this driver file does not provide access to DB2 for z/OS, you can
leave it as part of the variable definition.
- The native files of .so type are required by the DB2
Universal JDBC Driver in WebSphere Application Server for z/OS. Set the library
path variable ${DB2UNIVERSAL_JDBC_DRIVER_NATIVEPATH} to the
directory that contains the native files. (In cases that do not require native
files, set the DB2UNIVERSAL_JDBC_DRIVER_NATIVEPATH to null.)
The driver requires
DataStoreHelper class:
com.ibm.websphere.rsadapter.DB2UniversalDataStoreHelper
It also requires a valid authentication alias.
The DB2 Universal JDBC
Driver requires the following properties:
- databaseName This is a locally cataloged database name.
- driverType This is the JDBC connectivity type of a data source. If
you are running a version of DB2 prior to DB2 V8.1 FP6, you are restricted
to using only the type 2 driver.
- serverName The TCP/IP address or host name for the Distributed
Relational Database Architecture (DRDA) server. Provide a value for this
property only if your driverType is set to 4. This property
is not required if your driverType is set to 2.
- portNumber The TCP/IP port number where the DRDA server resides.
Provide a value for this property only if your driverType is set to 4.
This property is not required if your driverType is set to 2.
Optional properties: DB2 supports additional
connection properties for the DB2 Universal JDBC Driver; set them as custom
properties on the data source. For information about these optional data
source properties, consult the Application Programming Guide and Reference
for Java for your version of DB2 for z/OS.