IBM Support

java.lang.UnsatisfiedLinkError: SQLConnect error connecting to DB2 type 2 datasource

Troubleshooting


Problem

When trying to connect to a DB2® type 2 datasource from WebSphere® Application Server error java.lang.UnsatisfiedLinkError: SQLConnect occurs.

Symptom

A type 2 driver has a native library that must be loaded by the jvm process. A java.lang.UnsatisfiedLinkError means that the WebSphere Application Server jvm process could not find or could not load the DB2 library.

The following java stack is typical of an UnsatisfiedLinkError using the DB2 legacy driver

java.lang.UnsatisfiedLinkError:
COM/ibm/db2/jdbc/app/DB2Connection.SQLConnect(Ljava/lang/String;II)I
at COM.ibm.db2.jdbc.app.DB2Connection.connect(Unknown Source)
at COM.ibm.db2.jdbc.app.DB2Connection.<init>(Unknown Source)
at COM.ibm.db2.jdbc.app.DB2ReusableConnection.<init>(Unknown
Source)
at COM.ibm.db2.jdbc.DB2PooledConnection.getConnection(Unknown
Source)
at
com.ibm.ws.rsadapter.spi.WSRdbDataSource.getConnection(WSRdbDataSource.j
ava:1768)


The DB2 legacy driver uses these two files
  • db2java.zip -- this is the file that contains the java portion of the driver
  • libdb2jdbc.a|so or db2jdbc.dll -- this is the native library for the legacy driver.
The following java stack is typical of an UnsatisfiedLinkError using the DB2 universal driver.
[7/22/10 4:29:14:723 PDT] 00000023 SystemOut O com.ibm.db2.jcc.am.
SqlException: [jcc][10389][12245][3.59.81] Failure in loading native
library db2jcct2, java.lang.UnsatisfiedLinkError: /opt/IBM/db2/V9.
7/lib32/libdb2jcct2.so: load ENOEXEC on shared library(s)
/opt/IBM/db2/V9.7/lib32/libdb2jcct2.so
/udb1/bassprod/sqllib/lib64/libdb2.a: ERRORCODE=-4472, SQLSTATE=null
at com.ibm.db2.jcc.am.dd.a(dd.java:660)
at com.ibm.db2.jcc.am.dd.a(dd.java:60)
at com.ibm.db2.jcc.am.dd.a(dd.java:94)
at com.ibm.db2.jcc.t2.a.a(a.java:37)
at com.ibm.db2.jcc.t2.T2Configuration.<clinit>(T2Configuration.
java:95)
at com.ibm.db2.jcc.DB2BaseDataSource.instantiateLogWriter
(DB2BaseDataSource.java:10185)
at com.ibm.db2.jcc.DB2BaseDataSource.
computeJccLogWriterForNewConnection(DB2BaseDataSource.java:10106)
at com.ibm.db2.jcc.DB2BaseDataSource.
computeJccLogWriterForNewConnection(DB2BaseDataSource.java:10062)
at com.ibm.db2.jcc.DB2ConnectionPoolDataSource.
getPooledConnection(DB2ConnectionPoolDataSource.java:218)

The DB2 universal (UDB) driver uses these two files
  • db2jcc.jar -- this is the file that contains the java portion of the driver
  • libdb2jcct2.a|so or db2jcct2.dll -- this is the native library for the DB2 universal driver.

[{"Product":{"code":"SSEQTP","label":"WebSphere Application Server"},"Business Unit":{"code":"BU048","label":"IBM Software"},"Component":"Java 2 Connectivity (J2C)","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF010","label":"HP-UX"},{"code":"PF012","label":"IBM i"},{"code":"PF016","label":"Linux"},{"code":"PF027","label":"Solaris"},{"code":"PF035","label":"z\/OS"}],"Version":"9.0;8.5.5;8.0;7.0","Edition":"Base;Express;Network Deployment","Line of Business":{"code":"LOB77","label":"Automation Platform"}},{"Product":{"code":"SSNVBF","label":"Runtimes for Java Technology"},"Business Unit":{"code":"BU054","label":"Systems w\/TPS"},"Component":"Java SDK","Platform":[{"code":"","label":""}],"Version":"","Edition":"","Line of Business":{"code":"LOB08","label":"Cognitive Systems"}}]

Log InLog in to view more of this document

This document has the abstract of a technical article that is available to authorized users once you have logged on. Please use Log in button above to access the full document. After log in, if you do not have the right authorization for this document, there will be instructions on what to do next.

Document Information

Modified date:
03 March 2025

UID

swg21110708