IBM Support

ClassNotFoundException when using DB2 ConnectionPoolDataSource

Troubleshooting


Problem

A []ClassNotFoundException[] occurs in the Test Environment when you use []DB2ConnectionPoolDataSource[] to connect to DB2® v7.x.

Resolving The Problem

A ClassNotFoundException can occur if you are using the JDBC 1.0 driver as opposed to the JDBC 2.0 driver. When you apply a DB2 fix pack, the JDBC driver version may be changed back to 1.0.

You need to stop all DB2 services prior to performing the following instructions to ensure that all the required files are copied successfully.

To switch to JDBC 2.0, do the following steps:

  1. Open a command prompt.
  2. Run the batch file usejdbc2 from directory DB2_install_dir/SQLLIB/java12, where DB2_install_dir is the directory where DB2 is installed.

You can run the usejdbc1 and usejdbc2 batch files to switch the DB2 JDBC driver between JDBC 1.0 and JDBC 2.0. Usejdbc1 and usejdbc2 copy the required versions of the files into the DB2_install_dir/SQLLIB/java and DB2_install_dir/SQLLIB/bin directories.

To determine the current JDBC driver that is in use, you can view DB2_install_dir/SQLLIB/java12/inuse. Inuse describes the current JDBC driver that is in use. This file changes whenever you change drivers. For example, open the file inuse with a text editor, if “JDBC 2.0" appears you are using the JDBC 2.0 driver.





[{"Product":{"code":"SS2MD7","label":"WebSphere Studio Site Developer"},"Business Unit":{"code":"BU053","label":"Cloud \u0026 Data Platform"},"Component":"Relational database tools","Platform":[{"code":"PF016","label":"Linux"},{"code":"PF033","label":"Windows"}],"Version":"4.0.3;5.0;5.0.1;5.1;5.1.1;5.1.2","Edition":"All Editions","Line of Business":{"code":"","label":""}},{"Product":{"code":"SSBRLP","label":"WebSphere Studio Application Developer"},"Business Unit":{"code":"BU050","label":"BU NOT IDENTIFIED"},"Component":"Relational database tools","Platform":[{"code":"PF016","label":"Linux"},{"code":"PF033","label":"Windows"}],"Version":"4.0;4.02;4.03;5.0;5.0.1;5.1;5.1.1","Edition":"All Editions","Line of Business":{"code":"","label":""}},{"Product":{"code":"SS3M8D","label":"WebSphere Studio Enterprise Developer"},"Business Unit":{"code":"BU053","label":"Cloud \u0026 Data Platform"},"Component":"Relational database tools","Platform":[{"code":"","label":"Linux\/390"},{"code":"PF033","label":"Windows"}],"Version":"5.0;5.0.1","Edition":"All Editions","Line of Business":{"code":"","label":""}},{"Product":{"code":"SUPPORT","label":"IBM Worldwide Support"},"Business Unit":{"code":"BU051","label":"N\/A"},"Component":"Relational database tools","Platform":[{"code":"PF033","label":"Windows"},{"code":"PF016","label":"Linux"}],"Version":"4.1;4.1.1;5.0;5.0.1","Edition":"All Editions","Line of Business":{"code":"LOB33","label":"N\/A"}}]

Historical Number

65975
004
000

Document Information

More support for:
WebSphere Studio Site Developer

Software version:
4.0.3, 5.0, 5.0.1, 5.1, 5.1.1, 5.1.2

Operating system(s):
Linux, Windows

Document number:
722471

Modified date:
19 August 2022

UID

swg21078529

Manage My Notification Subscriptions