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=DSNC10.SDSNEXIT:DSNC10.SDSNLOAD:DSNC10.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/db2c10/jdbc, modify PATH as follows:
export PATH=/usr/lpp/db2c10/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/db2c10/jdbc, modify LIBPATH as follows:
export LIBPATH=/usr/lpp/db2c10/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.

db2jcc_license_cisuz.jar
A license file that permits access to the Db2 server.

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

export CLASSPATH=/usr/lpp/db2c10/jdbc/classes/db2jcc4.jar:\
/usr/lpp/db2c10/jdbc/classes/db2jcc_javax.jar:\
/usr/lpp/db2c10/jdbc/classes/sqlj4.zip:\
/usr/lpp/db2c10/jdbc/classes/db2jcc_license_cisuz.jar:\
$CLASSPATH

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