By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,496 Members | 1,489 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,496 IT Pros & Developers. It's quick & easy.

Problem when connecting to DB2 from standalone java application

P: n/a
Hii ,

I am trying to use a type 2 driver to connect to DB2 0n AIX 5
I have a small java test to class to establish a conneciton with the db
.. I am NOT using WAS or any appserver
When I try to connect to the DB I get the following exception

[Signaling in VM: java/lang/UnsatisfiedLinkError, message:
/usr/java14/jre/bin/libdb2jdbc.a: A file or directory in the path name
does not exist.]
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.jav a:2120)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java :1986)
at java.lang.Runtime.loadLibrary0(Runtime.java:824)
at java.lang.System.loadLibrary(System.java:908)
at COM.ibm.db2.jdbc.app.DB2Driver$3.run(Unknown Source)
at java.security.AccessController.doPrivileged1(Nativ e Method)
at
java.security.AccessController.doPrivileged(Access Controller.java:287)
at COM.ibm.db2.jdbc.app.DB2Driver.<init>(Unknown Source)
at COM.ibm.db2.jdbc.app.DB2Driver.<clinit>(Unknown Source)
at java.lang.Class.forName1(Native Method)
at java.lang.Class.forName(Class.java:180)
at test.main(test.java:11)
[Loaded java.lang.ClassLoader$4 from /usr/java14/jre/lib/core.jar]
[Signaling in VM: java/lang/UnsatisfiedLinkError, message:
/usr/java14/jre/bin/libdb2jdbc.a: A file or directory in the path name
does not exist.]
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.jav a:2120)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java :1998)
at java.lang.Runtime.loadLibrary0(Runtime.java:824)
at java.lang.System.loadLibrary(System.java:908)
at COM.ibm.db2.jdbc.app.DB2Driver$3.run(Unknown Source)
at java.security.AccessController.doPrivileged1(Nativ e Method)
at
java.security.AccessController.doPrivileged(Access Controller.java:287)
at COM.ibm.db2.jdbc.app.DB2Driver.<init>(Unknown Source)
at COM.ibm.db2.jdbc.app.DB2Driver.<clinit>(Unknown Source)
at java.lang.Class.forName1(Native Method)
at java.lang.Class.forName(Class.java:180)
at test.main(test.java:11)
[Signaling in VM: java/lang/UnsatisfiedLinkError, message:
/usr/java14/jre/bin/classic/libdb2jdbc.a: A file or directory in the
path name does not exist.]
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.jav a:2120)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java :1998)
at java.lang.Runtime.loadLibrary0(Runtime.java:824)
at java.lang.System.loadLibrary(System.java:908)
at COM.ibm.db2.jdbc.app.DB2Driver$3.run(Unknown Source)
at java.security.AccessController.doPrivileged1(Nativ e Method)
at
java.security.AccessController.doPrivileged(Access Controller.java:287)
at COM.ibm.db2.jdbc.app.DB2Driver.<init>(Unknown Source)
at COM.ibm.db2.jdbc.app.DB2Driver.<clinit>(Unknown Source)
at java.lang.Class.forName1(Native Method)
at java.lang.Class.forName(Class.java:180)
at test.main(test.java:11)
[Signaling in VM: java/lang/UnsatisfiedLinkError, message:
/usr/java14/jre/bin/libdb2jdbc.a: A file or directory in the path name
does not exist.]
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.jav a:2120)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java :1998)
at java.lang.Runtime.loadLibrary0(Runtime.java:824)
at java.lang.System.loadLibrary(System.java:908)
at COM.ibm.db2.jdbc.app.DB2Driver$3.run(Unknown Source)
at java.security.AccessController.doPrivileged1(Nativ e Method)
at
java.security.AccessController.doPrivileged(Access Controller.java:287)
at COM.ibm.db2.jdbc.app.DB2Driver.<init>(Unknown Source)
at COM.ibm.db2.jdbc.app.DB2Driver.<clinit>(Unknown Source)
at java.lang.Class.forName1(Native Method)
at java.lang.Class.forName(Class.java:180)
at test.main(test.java:11)
[Signaling in VM: java/lang/UnsatisfiedLinkError, message:
/usr/lib/libdb2jdbc.a: A file or directory in the path name does not
exist.]
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.jav a:2120)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java :1998)
at java.lang.Runtime.loadLibrary0(Runtime.java:824)
at java.lang.System.loadLibrary(System.java:908)
at COM.ibm.db2.jdbc.app.DB2Driver$3.run(Unknown Source)
at java.security.AccessController.doPrivileged1(Nativ e Method)
at
java.security.AccessController.doPrivileged(Access Controller.java:287)
at COM.ibm.db2.jdbc.app.DB2Driver.<init>(Unknown Source)
at COM.ibm.db2.jdbc.app.DB2Driver.<clinit>(Unknown Source)
at java.lang.Class.forName1(Native Method)
at java.lang.Class.forName(Class.java:180)
at test.main(test.java:11)

Follwoing is the CLASSPATH and the PATH variables in by .profile

PATH=/home1/db2inst4/sqllib/lib:/usr/java14/bin:/usr/bin:/etc:/usr/sbin:/usr/ucb:$HOME/bin:/usr/bin/X11:/sbin:/home1/db2inst4/
sqllib/bin:.
CLASSPATH=/home1/prisma/sk143379/prismabatches/dwh/lib/log4j-1.2.8.jar:/home1/prisma/sk143379/prismabatches/dwh/lib/RaboLogger
..jar:/home1/prisma/sk143379/prismabatches/dwh/srinath:/home1/db2inst4/sqllib/java/db2java.zip:/home1/prisma/sk143379/prismabat
ches/dwh/config/rabologger:/home1/prisma/sk143379/prismabatches/dwh/classes:/home1/prisma/sk143379/prismabatches
LD_LIBRARY_PATH=:/home1/db2inst4/sqllib/lib

The java class only contains the statement to connect to the
Database.
In case someone has encountered the same problem please
Thanks

-Neeraj

Nov 12 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.