IBM Support

Class Names for IBM i Native and IBM DB2 Connect JDBC Drivers

Troubleshooting


Problem

This document clarifies the difference between the IBM i Developer Kit for Java JDBC driver (com.ibm.db2.jdbc.app.DB2Driver) and the DB2 Connect JDBC driver (COM.ibm.db2.jdbc.app.DB2Driver).

Resolving The Problem

The IBM i Developer Kit for Java JDBC driver (the native JDBC driver) and the DB2 Connect JDBC application driver share an identical class name. The class names of the drivers are as follows:

IBM i native JDBC:
com.ibm.db2.jdbc.app.DB2Driver

DB2 Connect Application JDBC:
COM.ibm.db2.jdbc.app.DB2Driver

The only outward difference between these two drivers is the "com" portion of the fully qualified class name. The native JDBC driver uses lowercase "com", while the DB2 Connect application driver uses uppercase COM. The two drivers are not compatible. Both are type 2 platform-dependent drivers developed for a specific JVM. The IBM i native JDBC driver can be used only on an IBM i JVM. It has dependencies on service programs only found in this environment. Similarly, the DB2 Connect application JDBC driver can be used only on the platform JVM where it is installed. It is tied to dynamic link libraries only found in the installed environment.

If an exception is encountered with a path that contains the COM.ibm.db2.app path, the DB2 Connect JAR file was likely added to the class path and must be removed. Use the native or toolbox JDBC driver.

Typical errors include class not found exceptions and unsatisfied link errors. The following is a stack trace from such an application that added db2java.zip (DB2 Connect) to the class path and attempted to create a JDBC connection with this class.

java.sql.SQLException: java.lang.UnsatisfiedLinkError: no db2jdbc in java.library.path    
      java/lang/Throwable.<init>(Ljava/lang/String;)V+4 (Throwable.java:90)                
      java/sql/SQLException.<init>(Ljava/lang/String;)V+1 (SQLException.java:78)          
      COM/ibm/db2/jdbc/app/DB2Driver.<init>()V+0 (DB2Driver.java:159)                      
...


The following is the stack trace that is received trying to use the DB2 Connect driver without adding the file to the class path:

java.lang.ClassNotFoundException: COM.ibm.db2.jdbc.app.DB2Driver                                    
      java/lang/Throwable.<init>(Ljava/lang/String;)V+4 (Throwable.java:90)                          
     java/lang/Exception.<init>(Ljava/lang/String;)V+1 (Exception.java:38)                          
      java/lang/ClassNotFoundException.<init>(Ljava/lang/String;)V+1 (ClassNotFoundException.java:65)
...


The native JDBC driver is included as part of the IBM Developer Kit for Java, part of IBM i operating system. The DB2 Connect product is part of the Db2 Product Family. For further information on one of the JDBC drivers, contact the appropriate support area.

[{"Product":{"code":"SWG60","label":"IBM i"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Component":"Data Access","Platform":[{"code":"PF012","label":"IBM i"}],"Version":"Version Independent","Edition":"","Line of Business":{"code":"LOB57","label":"Power"}}]

Historical Number

28184337

Document Information

Modified date:
26 December 2019

UID

nas8N1016829