The DB2® type 2 JDBC Driver will be used as an example,
though the following can apply to other type 2 JDBC drivers as well.
Cannot locate the required driver's native libraries
You can verify db2profile has been successfully sourced by stopping the
Websphere Application Server and adding the "env" command to the bottom of
<Websphere InstallRoot>/bin/startServer.sh script file to
print out the settings of all the environment variables used by the
Websphere Application Server's JVM and redirect the output to a file, for
example:
env > env.out
From the resulting env.out, verify the required environment variables
used by the JDBC Driver are listed and have the correct settings, for
example:
CLASSPATH=/home/db2inst1/sqllib/java12/db2java.zip
DB2INSTANCE=db2inst1
LIBPATH=/home/db2inst1/sqllib/lib
Notes:
The library path environment variable is LD_LIBRARY_PATH for Linux®
& SUN , LIBPATH for AIX® and SHLIB_PATH for HP-UX.
db2inst1 is the name of the DB2 instance in this example. Your
DB2 instance may have a different name.
/home/db2inst1/ is the directory where DB2 is installed. Your DB2
installation path may be different.
- From your Websphere Administrative Console,
Resources > JDBC Provider > <Your JDBC
Provider>
In the Configuration panel, under the General Properties
section, specify the directory where the driver's native libraries are
located in the Native Library Path field, for example:
/home/db2inst1/sqllib/lib
The loaded version of the native libraries that do not match the
version of the driver
- The JDBC driver level does match the native libraries
used.
- Multiple copies of db2java.zip are on the JVM's system
classpath. Even though the Websphere configuration points to a specific
driver, since the driver consist of multiple classes, the classloader can
cause classes in the wrong driver's jar/zip to be invoked, which do not
match the native libraries used.
Websphere Application Server's Java Virtual Machine (JVM) cannot
load the native libraries
- Websphere Application Server cannot load 64-bit libraries.
Interrogate your DB2 version by issuing the command "db2level". This
should produce an output similar to the following:
DB21085I Instance "DB2" uses "32" bits and DB2 code release
"SQL08020" with level identifier "03010106". Informational tokens are "DB2
v8.1.7.445", "s040812", "WR21342", and FixPak "7".
|