I am having this annoying problem of loading DB2 driver from a JAVA application on AIX5.3, what I got is this :
java.sql.SQLException: java.lang.UnsatisfiedLinkError: db2jdbc (A file or directory in the path name does not exist.)
at COM.ibm.db2.jdbc.app.DB2Driver.(Unknown Source)
at java.lang.Class.newInstanceImpl(Native Method)
at java.lang.Class.newInstance(Class.java:1243)
at com.hp.sm.doctor.collection.commandLineConsole.CommandLineEntryMain.main(CommandLineEntryMain.java:143)
I googled a lot, seems I am all set with everything, but this exception won’t go away..
Here are details:
PATH=/usr/java5/bin:/usr/bin:/etc:/usr/sbin:/usr/ucb:/usr/bin/X11:/sbin:/usr/java14/jre/bin:/usr/java14/bin:/home/scuser/SC6283/RUN:/home/fpeSM/sqllib/bin:/home/fpeSM/sqllib/adm:/home/fpeSM/sqllib/misc
CLASSPATH=/home/fpeSM/sqllib/java/db2java.zip:/home/fpeSM/sqllib/java/db2jcc.jar:/home/fpeSM/sqllib/java/sqlj.zip:/home/fpeSM/sqllib/function:/home/fpeSM/sqllib/java/db2jcc_license_cu.jar:.
LIBPATH=/usr/lib:/lib:/home/fpeSM/sqllib/lib64
I run my script by
java -cp /home/fpeSM/sqllib/java/db2java.zip:/home/fpeSM/sqllib/java/db2jcc.jar:/home/fpeSM/sqllib/java/sqlj.zip:/home/fpeSM/sqllib/function:/home/fpeSM/sqllib/lib32:/home/fpeSM/sqllib/java/db2jcc_license_cu.jar:.:smdoctor.jar com.hp.sm.doctor.collection.commandLineConsole.CommandLineEntryMain
Can anyone tell me what’s gist to make the whole thing work? Many many.. thanks!
P.S., libdb2jdbc.so DOES exist under /home/fpeSM/sqllib/lib64.
Even
Try telling Java where the DB2 native libraries are located by adding
-Djava.library.path=/home/fpeSM/sqllib/lib64:...to your command. Your PATH and CLASSPATH variables and command raises some questions:available on the PATH?
available on the CLASSPATH.
db2java.zipprovides the DB2 JDBC type 2 and 4drivers and
db2jcc.jarprovides the DB2 JDBC type 4 driver. DB2did away with the type 2 JDBC driver somewhere around version late-8
or early-9.
library is a 32-bit library. I’m not familiar with AIX, but for Linux I would use
file libdb2jdbc.soto check if it’s a 32-bit or 64-bit library.