| senthilssg Beginner
 
  
 Joined: 19 Jan 2006
 Posts: 4
 Topics: 4
 
 
 | 
			
				|  Posted: Thu May 11, 2006 8:21 am    Post subject: DB2 JDBC driver was unable to determine the correct DLL name |   |  
				| 
 |  
				| Hi , 
 
 I am trying to run a sample Java program with Jdbc conection  to access the data in the DB2 V7 which is running on z os  thru OMVS.
 
 Here i am using jdk 1.4 for that  and jdbc type 2 driver .
 
 I  got the following error when i ran the sample program which is supplied by  Ibm .
 
 
 
  	  | Code: |  	  | 
 [b]Error: DB2 JDBC driver was unable to determine the correct DLL name to load[/b].                                                                                                                                                                                                                                                                                                                            00010000
 Current System Properties follow:                                                                                                                                                                                                                                                                                                                                                                       00020000
 -- listing properties --                                                                                                                                                                                                                                                                                                                                                                                00030000
 java.assistive=ON                                                                                                                                                                                                                                                                                                                                                                                       00040000
 platform.notASCII=true                                                                                                                                                                                                                                                                                                                                                                                  00050000
 java.runtime.name=Java(TM) 2 Runtime Environment, Stand...                                                                                                                                                                                                                                                                                                                                              00060000
 sun.boot.library.path=/usr/lpp/java1.4.2/J1.4/bin                                                                                                                                                                                                                                                                                                                                                       00070000
 java.vm.version=1.4.2                                                                                                                                                                                                                                                                                                                                                                                   00080000
 java.vm.vendor=IBM Corporation                                                                                                                                                                                                                                                                                                                                                                          00090000
 java.vendor.url=http://www.ibm.com/                                                                                                                                                                                                                                                                                                                                                                     00100000
 path.separator=:                                                                                                                                                                                                                                                                                                                                                                                        00110000
 java.vm.name=Classic VM                                                                                                                                                                                                                                                                                                                                                                                 00120000
 file.encoding.pkg=sun.io                                                                                                                                                                                                                                                                                                                                                                                00130000
 sun.os.patch.level=                                                                                                                                                                                                                                                                                                                                                                                     00140000
 java.vm.specification.name=Java Virtual Machine Specification                                                                                                                                                                                                                                                                                                                                           00150000
 user.dir=/usr/ssg/ssghts                                                                                                                                                                                                                                                                                                                                                                                00160000
 java.runtime.version=1.4.2                                                                                                                                                                                                                                                                                                                                                                              00170000
 java.fullversion=J2RE 1.4.2 IBM z/OS Persistent Reusab...                                                                                                                                                                                                                                                                                                                                               00180000
 java.awt.graphicsenv=sun.awt.X11GraphicsEnvironment                                                                                                                                                                                                                                                                                                                                                     00190000
 java.endorsed.dirs=/usr/lpp/java1.4.2/J1.4/lib/endorsed                                                                                                                                                                                                                                                                                                                                                 00200000
 os.arch=390                                                                                                                                                                                                                                                                                                                                                                                             00210000
 com.ibm.vm.bitmode=32                                                                                                                                                                                                                                                                                                                                                                                   00220000
 java.io.tmpdir=/usr/tmp                                                                                                                                                                                                                                                                                                                                                                                 00230000
 line.separator=                                                                                                                                                                                                                                                                                                                                                                                         00240000
 00250000
 java.vm.specification.vendor=Sun Microsystems Inc.                                                                                                                                                                                                                                                                                                                                                      00260000
 java.awt.fonts=                                                                                                                                                                                                                                                                                                                                                                                         00270000
 os.name=z/OS                                                                                                                                                                                                                                                                                                                                                                                            00280000
 sun.java2d.fontpath=                                                                                                                                                                                                                                                                                                                                                                                    00290000
 java.library.path=/usr/lpp/java1.4.2/J1.4/bin/classic/l...                                                                                                                                                                                                                                                                                                                                              00300000
 java.specification.name=Java Platform API Specification                                                                                                                                                                                                                                                                                                                                                 00310000
 java.class.version=48.0                                                                                                                                                                                                                                                                                                                                                                                 00320000
 ibm.system.encoding=Cp1047                                                                                                                                                                                                                                                                                                                                                                              00330000
 java.util.prefs.PreferencesFactory=java.util.prefs.FileSystemPreferences...                                                                                                                                                                                                                                                                                                                             00340000
 invokedviajava=                                                                                                                                                                                                                                                                                                                                                                                         00350000
 os.version=01.04.00                                                                                                                                                                                                                                                                                                                                                                                     00360000
 user.home=/opt/dfslocal/home/dfscntl                                                                                                                                                                                                                                                                                                                                                                    00370000
 user.timezone=                                                                                                                                                                                                                                                                                                                                                                                          00380000
 java.awt.printerjob=sun.print.PSPrinterJob                                                                                                                                                                                                                                                                                                                                                              00390000
 java.specification.version=1.4                                                                                                                                                                                                                                                                                                                                                                          00400000
 file.encoding=Cp1047                                                                                                                                                                                                                                                                                                                                                                                    00410000
 user.name=DFS                                                                                                                                                                                                                                                                                                                                                                                           00420000
 java.class.path=/usr/lpp/db2/db2710/classes/db2sqljcl...                                                                                                                                                                                                                                                                                                                                                00430000
 java.vm.specification.version=1.0                                                                                                                                                                                                                                                                                                                                                                       00440000
 sun.arch.data.model=32                                                                                                                                                                                                                                                                                                                                                                                  00450000
 java.home=/usr/lpp/java1.4.2/J1.4                                                                                                                                                                                                                                                                                                                                                                       00460000
 java.specification.vendor=Sun Microsystems Inc.                                                                                                                                                                                                                                                                                                                                                         00470000
 user.language=en                                                                                                                                                                                                                                                                                                                                                                                        00480000
 java.vm.info=J2RE 1.4.2 IBM z/OS Persistent Reusab...                                                                                                                                                                                                                                                                                                                                                   00490000
 java.version=1.4.2                                                                                                                                                                                                                                                                                                                                                                                      00500000
 java.ext.dirs=/usr/lpp/java1.4.2/J1.4/lib/ext                                                                                                                                                                                                                                                                                                                                                           00510000
 sun.boot.class.path=/usr/lpp/java1.4.2/J1.4/lib/core.jar:...                                                                                                                                                                                                                                                                                                                                            00520000
 java.vendor=IBM Corporation                                                                                                                                                                                                                                                                                                                                                                             00530000
 file.separator=/                                                                                                                                                                                                                                                                                                                                                                                        00540000
 java.vendor.url.bug=                                                                                                                                                                                                                                                                                                                                                                                    00550000
 java.compiler=jitc                                                                                                                                                                                                                                                                                                                                                                                      00560000
 sun.io.unicode.encoding=UnicodeBig                                                                                                                                                                                                                                                                                                                                                                      00570000
 SQLException loading DLL/registering JDBC Driver                                                                                                                                                                                                                                                                                                                                                        00580000
 SQLSTATE is FFFFF                                                                                                                                                                                                                                                                                                                                                                                       00590000
 SQLCODE  is -1                                                                                                                                                                                                                                                                                                                                                                                          00600000
 java.sql.SQLException: Error: DB2 JDBC Driver was unable to determine the correct DLL name to load                                                                                                                                                                                                                                                                                                      00610000
 The java class could not be loaded. java.lang.ExceptionInInitializerError                                                                                                                                                                                                                                                                                                                               00620000
 
 | 
 
 
 
 
 this is the environmental settings which i  have set before executing the java pgm .
 
 
 
 
 
  	  | Code: |  	  | PATH=/bin:/usr/lpp/java1.4.2/J1.4/bin:$PATH
 export PATH
 JAVA_HOME=/usr/lpp/java1.4.2/J1.4
 export JAVA_HOME
 LIBPATH=$LIBPATH=/lib:/usr/lib:/usr/lpp/java1.4.2/J1.4/lib:.
 export LIBPATH
 export SYSPATH=DSN710.SDSNC.H:$SYSPATH
 export PATH=/usr/lpp/db2/db2710/bin:$PATH
 export LIBPATH=/usr:/usr/lib:/usr/lpp/db2/db2710/lib:$LIBPATH
 export LD_LIBRARY_PATH=/usr/lpp/db2/db2710/lib:$LD_LIBRARY_PATH
 export DSNAOINI="DSN710.CLIINI"
 export JDBC_HOME=/usr/lpp/db2/db2710
 export STEPLIB=DSN710.SDSNEXIT:DSN710.SDSNLOAD:DSN710.SDSNLOD2
 
 | 
 
 
 Please note that , this is the pgm i am trying to execute ( this is the sample pgm supplied by ibm .
 
 
 
  	  | Code: |  	  | 
 import java.sql.*;                                                                                                                                                                                                                                                                                                                                                                                      00220000
 00230000
 public class sample01 {                                                                                                                                                                                                                                                                                                                                                                                 00240000
 00250000
 static {                                                                                                                                                                                                                                                                                                                                                                                             00260000
 try {                                                                                                                                                                                                                                                                                                                                                                                             00270000
 // register the DB2 for OS/390 driver with DriverManager                                                                                                                                                                                                                                                                                                                                       00280000
 Class.forName("COM.ibm.db2os390.sqlj.jdbc.DB2SQLJDriver");                                                                                                                                                                                                                                                                                                                                     00290000
 } catch (ClassNotFoundException e) {                                                                                                                                                                                                                                                                                                                                                              00300000
 e.printStackTrace();                                                                                                                                                                                                                                                                                                                                                                           00310000
 }                                                                                                                                                                                                                                                                                                                                                                                                 00320000
 }                                                                                                                                                                                                                                                                                                                                                                                                    00330000
 00340000
 public static void main(String args[]) {                                                                                                                                                                                                                                                                                                                                                             00350000
 00360000
 String URLprefix = "jdbc:db2os390sqlj:";                                                                                                                                                                                                                                                                                                                                                          00370000
 String url;                                                                                                                                                                                                                                                                                                                                                                                       00380000
 try {                                                                                                                                                                                                                                                                                                                                                                                             00390000
 System.out.println("**** JDBC Entry within class sample01.");                                                                                                                                                                                                                                                                                                                                  00400000
 00410000
 // If an alternate URL is passed, then use it                                                                                                                                                                                                                                                                                                                                                  00420000
 if (args.length > 0)                                                                                                                                                                                                                                                                                                                                                                           00430000
 url = new String(URLprefix + args[0]);                                                                                                                                                                                                                                                                                                                                                      00440000
 else                                                                                                                                                                                                                                                                                                                                                                                           00450000
 url = new String(URLprefix);   //else use "local" DB2 location                                                                                                                                                                                                                                                                                                                              00460000
 00470000
 // Create the connection                                                                                                                                                                                                                                                                                                                                                                       00480000
 Connection con = DriverManager.getConnection (url);                                                                                                                                                                                                                                                                                                                                            00490000
 System.out.println("**** JDBC Connection to DB2 for OS/390.");                                                                                                                                                                                                                                                                                                                                 00500000
 00510000
 // Create the Statement                                                                                                                                                                                                                                                                                                                                                                        00520000
 Statement stmt = con.createStatement();                                                                                                                                                                                                                                                                                                                                                        00530000
 System.out.println("**** JDBC Statement Created");                                                                                                                                                                                                                                                                                                                                             00540000
 00550000
 // Execute a Query and generate a ResultSet instance                                                                                                                                                                                                                                                                                                                                           00560000
 // The Query is a Select from SYSIBM.SYSTABLES                                                                                                                                                                                                                                                                                                                                                 00570000
 ResultSet rs = stmt.executeQuery("SELECT * FROM SYSIBM.SYSTABLES");                                                                                                                                                                                                                                                                                                                            00580000
 System.out.println("**** JDBC Result Set Created");                                                                                                                                                                                                                                                                                                                                            00590000
 00600000
 // Print all of the table names to sysout                                                                                                                                                                                                                                                                                                                                                      00610000
 while (rs.next()) {                                                                                                                                                                                                                                                                                                                                                                            00620000
 String s = rs.getString(1);                                                                                                                                                                                                                                                                                                                                                                  00630000
 System.out.println("Table NAME = " + s);                                                                                                                                                                                                                                                                                                                                                     00640000
 }                                                                                                                                                                                                                                                                                                                                                                                              00650000
 System.out.println("**** JDBC Result Set output completed");                                                                                                                                                                                                                                                                                                                                   00660000
 00670000
 // Close the resultset                                                                                                                                                                                                                                                                                                                                                                         00680000
 rs.close();                                                                                                                                                                                                                                                                                                                                                                                    00690000
 // Close the statement                                                                                                                                                                                                                                                                                                                                                                         00700000
 stmt.close();                                                                                                                                                                                                                                                                                                                                                                                  00710000
 System.out.println("**** JDBC Statement Closed");                                                                                                                                                                                                                                                                                                                                              00720000
 00730000
 // Close the connection                                                                                                                                                                                                                                                                                                                                                                        00740000
 con.close();                                                                                                                                                                                                                                                                                                                                                                                   00750000
 System.out.println("**** JDBC Disconnect from DB2 for OS/390.");                                                                                                                                                                                                                                                                                                                               00760000
 00770000
 System.out.println("**** JDBC Exit from class sample01 - no  Errors.");                                                                                                                                                                                                                                                                                                                        00780000
 00790000
 } catch( Exception e ) {                                                                                                                                                                                                                                                                                                                                                                          00800000
 e.printStackTrace();                                                                                                                                                                                                                                                                                                                                                                           00810000
 }                                                                                                                                                                                                                                                                                                                                                                                                 00820000
 00830000
 }                                                                                                                                                                                                                                                                                                                                                                                                    00840000
 }                                                                                                                                                                                                                                                                                                                                                                                                       00850000
 
 | 
 
 
 
 
 
 
 
 
 I  have checked with load modules of db2 is available in  db2 system .
 
 One more thging i have succesfullty executed the same java pgm, which is using jdbc and and access same the db2 v7 subsystem . under Jdk1.3  and it is worked fine .
 
 Same program which is executed under  JDK1.4 . it is giving above error .
 
 
 Error: DB2 JDBC driver was unable to determine the correct DLL name to load.
 
 
 These are my question reg that
 
 1. Does Db2 version on Zos  support JDK 1.4 and jdbc type 2 driver
 
 2 . Is there any PTF for the  above error .
 
 i have searched in IBm site for the above error , i am not getting any ptf for that .
 
 
 please give your views  about this issue .
 
 Thanks and Regards
 Senthil
 |  |