Environment variables for the IBM Data Server Driver for JDBC and SQLJ

If you set specific environment variables, the operating system can locate the IBM Data Server Driver for JDBC and SQLJ.

The environment variables that you must set are:
STEPLIB
Modify STEPLIB to include the SDSNEXIT, SDSNLOAD, and SDSNLOD2 data sets. For example:
export STEPLIB=DSND10.SDSNEXIT:DSND10.SDSNLOAD:DSND10.SDSNLOD2:$STEPLIB
PATH
Modify PATH to include the directory that contains the shell scripts that invoke IBM Data Server Driver for JDBC and SQLJ program preparation and debugging functions.
For example, if the IBM Data Server Driver for JDBC and SQLJ is installed in /usr/lpp/db2d10/jdbc, modify PATH as follows:
export PATH=/usr/lpp/db2d10/jdbc/bin:$PATH
LIBPATH
The IBM Data Server Driver for JDBC and SQLJ contains the following dynamic load libraries (DLLs):
  • libdb2jcct2zos.so
  • libdb2jcct2zos_64.so
Those DLLs contain the native (C or C++) implementation of the IBM Data Server Driver for JDBC and SQLJ. The driver uses this code when you use IBM Data Server Driver for JDBC and SQLJ type 2 connectivity.

Modify LIBPATH to include the directory that contains these DLLs.

For example, if the IBM Data Server Driver for JDBC and SQLJ is installed in /usr/lpp/db2d10/jdbc, modify LIBPATH as follows:
export LIBPATH=/usr/lpp/db2d10/jdbc/lib:$LIBPATH
CLASSPATH
The IBM Data Server Driver for JDBC and SQLJ contains the following class files:
db2jcc4.jar
Contains all JDBC classes and the SQLJ runtime classes for the IBM Data Server Driver for JDBC and SQLJ.

Include db2jcc4.jar in the CLASSPATH to indicate that you are using the version of the IBM Data Server Driver for JDBC and SQLJ that includes JDBC 4.0 and later functions, as well as JDBC 3.0 and earlier functions.

sqlj4.zip
Contains the classes that are needed to prepare SQLJ applications for execution under the IBM Data Server Driver for JDBC and SQLJ.

Include sqlj4.zip in the CLASSPATH to indicate that you plan to prepare SQLJ applications that include JDBC 4.0 and later functions, as well as JDBC 3.0 and earlier functions.

license-file-name
A license file that permits access to Db2 for z/OS® servers.

Before version 4.34 of the IBM Data Server Driver for JDBC and SQLJ, the license file name is db2jcc_license_cisuz.jar. Starting with version 4.34 of the IBM Data Server Driver for JDBC and SQLJ, see the following table for the license file name.

The following table lists the license file names and Db2 Connect editions.
Table 1. License JAR file names and Db2 Connect editions
License JAR file name Db2 Connect edition
db2jcc_license_consvZS.jar Db2 Connect Unlimited Edition for System z
db2jcc_license_consvIS.jar Db2 Connect Unlimited Edition for System i
db2jcc_license_consvAS.jar Db2 Connect Application Server Edition
db2jcc_license_consvEE.jar Db2 Connect Enterprise Edition
db2jcc_license_consvAAS.jar Db2 Connect Application Server Advanced Edition
db2jcc_license_consvAZS.jar Db2 Connect Unlimited Advanced Edition for System z

Modify your CLASSPATH to include these files. If the IBM Data Server Driver for JDBC and SQLJ is installed in /usr/lpp/db2d10/jdbc, modify CLASSPATH as follows:

export CLASSPATH=/usr/lpp/db2d10/jdbc/classes/db2jcc4.jar:\
/usr/lpp/db2d10/jdbc/classes/db2jcc_javax.jar:\
/usr/lpp/db2d10/jdbc/classes/sqlj4.zip:\
/usr/lpp/db2d10/jdbc/classes/license-file-name:\
$CLASSPATH

If you use Java stored procedures, you need to set additional environment variables in a JAVAENV data set.