Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

java.lang.UnsatisfiedLinkError: Can't find library db2jdbc  (libdb2jdbc.so) in java.library.path

Posted on 2006-10-30
3
Medium Priority
?
2,727 Views
Last Modified: 2007-12-19
Hello,

I am trying to run my standalone java application in a unix box through a shell script.  There is no WAS(websphere application server or a webserver involved). I get the following error while the main method attempts to make a database connection to DB2:
Class ConnectPool: Function getDatabaseConnection java.sql.SQLException: java.lang.UnsatisfiedLinkError: Can't find library db2jdbc  (libdb2jdbc.so) in java.library.path
java.library.path=/usr/lpp/java/IBM/J1.3/bin/:/usr/lpp/java/IBM/J1.3/bin/classic:/usr/lpp/db2/db2710/lib:/clocal/java/mqm/java/lib:/usr/lib
Exception in getConnectionjava.sql.SQLException: No suitable driver.

The shell script is as follows:

#!/bin/sh
export CLASSPATH=/usr/lpp/servlets/com/dcx/restricted/slsmkt/compdb/activation.jar:\
/usr/lpp/servlets:\
/usr/lpp/servlets/com/dcx/restricted/slsmkt/compdb/db2java.zip:\
/usr/lpp/servlets/com/dcx/restricted/slsmkt/compdb/dccommon.jar:\
/usr/lpp/servlets/com/dcx/restricted/slsmkt/compdb/ibmjsse.jar:\
/usr/lpp/servlets/com/dcx/restricted/slsmkt/compdb/jsse.jar:\
/usr/lpp/servlets/com/dcx/restricted/slsmkt/compdb/servlet.jar:\
/usr/lpp/servlets/com/dcx/restricted/slsmkt/compdb/xerces.jar:\
/usr/lpp/servlets/com/dcx/restricted/slsmkt/compdb/smtp.jar:\
/usr/lpp/servlets/com/dcx/restricted/slsmkt/compdb/xml-apis-2_5_0.jar:\
/usr/lpp/cicsts/ctg/classes/ctgclient.jar:\
/usr/lpp/cicsts/ctg/classes/ctgserver.jar:\
/usr/lpp/servlets/com/dcx/restricted/slsmkt/compdb/recjava.jar:\
/usr/lpp/java/IBM/J1.3/lib/ext/recordio.jar:\
/clocal/java/jaf/activation.jar:\
/clocal/java/javamail/mail.jar:\
/usr/lpp/servlets:\
/usr/lpp/db2/db2710/classes/db2jdbcclasses.zip:\
/usr/lpp/db2/db2710/classes/db2sqljclasses.zip:\
/usr/lpp/db2/db2710/classes/db2j2classes.zip:\
/usr/lpp/db2/db2710/classes/db2sqljruntime.zip:\
/usr/lpp/servlets/com/dcx/restricted/slsmkt/compdb/qpartret.properties\

export JAVA_HOME=/usr/lpp/java/IBM/J1.3
export LD_LIBRARY_PATH=/usr/lpp/db2/db2710/lib:/clocal/java/mqm/java/lib
export LIBPATH=/usr/lpp/db2/db2710/lib:/clocal/java/mqm/java/lib
export STEPLIB=TSYS.DSNLOAD
export DB2SQLJPROPERTIES=/usr/lpp/websrvw/WebSphere/server/properties/db2sqljjdbc.properties

/usr/lpp/java/IBM/J1.3/bin/java com.dcx.restricted.slsmkt.compdb.RMU_UPS_ShippingBatch_Main

This is urgent. I would really appreciate if you could point me to right direction.

Regards
Jignesh
0
Comment
Question by:Jigspat
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 2

Assisted Solution

by:nagwani1
nagwani1 earned 1000 total points
ID: 17837576
make sure libdb2jdbc.so is in PATH variable
0
 
LVL 92

Accepted Solution

by:
objects earned 1000 total points
ID: 17841124
put libdb2jdbc.so in one of the directories in java.library.path
0
 

Author Comment

by:Jigspat
ID: 17852187
That works. Thank you very much.
0

Featured Post

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

661 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question