WebSphere database connection exception java.lang.UnsatisfiedLinkError
PMcAdams 120000FY75 Visits (11123)
Problem: Selecting the WebSphere datasource test connection button results in a java
This exception typically results when using a type 2 JDBC driver and one or more of the following conditions occur:
Each of the above conditions is listed below. Note the DB2 type 2 JDBC Driver is used as an example, but be aware this problem can occur with any type 2 driver.
Cannot locate the required driver's native libraries
For UNIX, edit the root user's .profile and add a line to source the db2profile.sh script to set up the required environment variables for DB2 (i.e. DB2INSTANCE, CLASSPATH, LD_LIBRARY_PATH, etc). For example: ./ho
You can verify db2profile has been successfully sourced by stopping the WebSphere Application Server and adding the "env" command to the bottom of <WebSphere Inst
From the resulting env.out, verify the required environment variables used by the JDBC Driver are listed and have the correct settings, for example:
From your WebSphere Administrative Console:
Resources > JDBC Provider > <Your JDBC Provider>
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 or there are multiple copies of the JDBC driver 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 v18.104.22.1685", "s040812", "WR21342", and FixPak "7".
Change the WebSphere datasource from driver type 2 to driver type 4. Most users prefer the type 4 JDBC driver because it can be included with the application and does not depend on external libraries. Type 2 drivers always require a shared library because communication between the driver and the server is handled in the driver's non-Java component. The type 4 driver is pure java, does not use a database client or native libraries, and performs better than a type 2 driver.