Datasource TestConnection fails in WebSphere Application Server V5.0 when using Type 2 DB2 Universal JDBC driver V8.0
 Technote (troubleshooting)
 
Problem(Abstract)
When testing the connection from the Administrative Console to a datasource configured under the Type 2 IBM® DB2® V8.0 Universal JDBC driver, exception "java.lang.Exception: com.ibm.db2.jcc.c.SqlException: Failure in loading T2 native library db2jcct2" is received.
 
Cause
Excerpt of the exception:


Test Connection failed for datasource PPSDB on server server1 at node myNode with the following exception:
java.lang.Exception: com.ibm.db2.jcc.c.SqlException: Failure in loading T2 native library db2jcct2. View JVM logs for further details.

The SystemOut.log will show the following stacktrace:
[1/27/05 17:11:30:771 MST] 542f4b17 WebGroup I SRVE0180I: [adminconsole] [/admin] [Servlet.LOG]: action: DataSourceDetailForm was null.Creating new form bean and storing in session
[1/27/05 17:11:31:267 MST] 542f4b17 DataSourceCon E DSRA8040I: Failed to connect to the DataSource. Encountered : java.lang.Exception: com.ibm.db2.jcc.c.SqlException: Failure in loading T2 native library db2jcct2
at com.ibm.ws.rsadapter.DSConfigurationHelper.testConnectionForGUI(DSConfigurationHelper.java:1810)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java(Compiled Code))
at java.lang.reflect.Method.invoke(Method.java(Compiled Code))
at com.ibm.ws.management.DataSourceConfigHelperMBean.testConnectionToDataSource2(DataSourceConfigHelperMBean.java:523)

The cause of the problem is a mismatch in the bit level of IBM WebSphere® Application Server and the DB2 native libraries: WebSphere Application Server is a 32-bit application and DB2 client is 64-bit.

WebSphere Application Server cannot interact with a 64-bit DB2 client. It can, however, interact with a 64-bit DB2 server when a 32-bit DB2 client instance is used in between.

 
Resolving the problem
To resolve this problem, the following are two options:
  1. Configure a 32-bit DB2 client instance on the WebSphere Application Server machine and catalog the remote (or local) database in this instance.
  2. Use the Type 4 DB2 Universal JDBC driver instead of the Type 2 driver. The Type 4 driver does not require the use of DB2 native libraries and hence would not encounter the problem described above.
 
 
Cross Reference information
Segment Product Component Platform Version Edition
Application Servers Runtimes for Java Technology Java SDK
 
 


Document Information


Product categories: Software > Application Servers > Distributed Application & Web Servers > WebSphere Application Server > DB Connections/Connection Pooling
Operating system(s): Solaris
Software version: 6.0.2
Software edition:
Reference #: 1201633
IBM Group: Software Group
Modified date: Feb 15, 2006