Ask a Question related to IBM DB2, Design and Development.
-
pico77 #1
Connect with Java to Linux DB2
Hello,
i want to connect with a java program to a db2 8.1 database.
both running on the same linux maschine.
that combination functioned on a windows 2000 pc before.
now i get the following error:
java.sql.SQLException: java.lang.UnsatisfiedLinkError: no db2jdbc in
java.library.path
at COM.ibm.db2.jdbc.app.DB2Driver.<init>(Unknown Source)
at sun.reflect.NativeConstructorAccessorImpl.newInsta nce0(Native
Method)
at sun.reflect.NativeConstructorAccessorImpl.newInsta nce(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newI nstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Construc tor.java:274)
at java.lang.Class.newInstance0(Class.java:306)
at java.lang.Class.newInstance(Class.java:259)
setting different enviroment variables in the program ...
System.setProperty("DB2_JDBC_DRIVER_PATH","/home/db2inst1/sqllib/java"); System.setProperty("DB2TEMPDIR","/home/db2inst1/sqllib"); System.setProperty("INCLUDE","/home/db2inst1/sqllib/INCLUDE:/home/db2inst1/sqllib/lib");
System.setProperty("LIB","/home/db2inst1/sqllib/lib"); System.setProperty("java.library.path","/opt/IBM/db2/V8.1/lib"); System.out.println(System.getProperty("DB2_JDBC_DR IVER_PATH")); System.out.println(System.getProperty("java.librar y.path"));
.... results that error:
/home/db2inst1/sqllib/java
/opt/IBM/db2/V8.1/lib
java.sql.SQLException: java.lang.UnsatisfiedLinkError: Can't find
library db2jdbc (libdb2jdbc.so) in java.library.path
java.library.path=/opt/IBM/db2/V8.1/lib
at COM.ibm.db2.jdbc.app.DB2Driver.<init>(Unknown Source)
at java.lang.Class.newInstance0(Native Method)
at java.lang.Class.newInstance(Class.java:262)
at os400tolinux.daten.<init>(daten.java:42)
at os400tolinux.daten.main(daten.java:58)
someone able to tell me what to do to get it work?
thx
pico77 Guest
-
Remote Java Web Service over HTTPS - How to Connect?
Hi all, I am using Coldfusion MX 6.1 to develop a web service client that has to connect to a remote Java web service over HTTPS (SSL over HTTP).... -
Using Java CFX on Linux
Just wanted to post a note to say thanks! Your info was VERY helpful. I appreciate it. Cheers, Craig -
Cannot connect to SQL 2k from MX7 (Linux)
Can someone confirm|deny that MX7 JDBC drivers fail to connect to a SQL 2k *SP4* server when the "force protocol encryption" is enabled? Same is... -
Warning: SQL procedures/Java/8.1.2 on Linux
Hello all, I'm writing this as a warning to others. We installed DB2 8.1.2 with all fixpaks onto our Linux server with the intention of moving our... -
Error when I try to connect to DB2 from JAVA
Hi, I am trying to connect to DB2 database from JAVA. This is following piece of code i am using to connect to DB2 database ... -
W Gemini #2
Re: Connect with Java to Linux DB2
pico77 wrote:
Run db2profile under sqllib directory. It will setup the load path for you.> Hello,
>
> i want to connect with a java program to a db2 8.1 database.
> both running on the same linux maschine.
> that combination functioned on a windows 2000 pc before.
> now i get the following error:
>
> java.sql.SQLException: java.lang.UnsatisfiedLinkError: no db2jdbc in
> java.library.path
> at COM.ibm.db2.jdbc.app.DB2Driver.<init>(Unknown Source)
> at sun.reflect.NativeConstructorAccessorImpl.newInsta nce0(Native
> Method)
> at sun.reflect.NativeConstructorAccessorImpl.newInsta nce(NativeConstructorAccessorImpl.java:39)
> at sun.reflect.DelegatingConstructorAccessorImpl.newI nstance(DelegatingConstructorAccessorImpl.java:27)
> at java.lang.reflect.Constructor.newInstance(Construc tor.java:274)
> at java.lang.Class.newInstance0(Class.java:306)
> at java.lang.Class.newInstance(Class.java:259)
>
>
> setting different enviroment variables in the program ...
>
> System.setProperty("DB2_JDBC_DRIVER_PATH","/home/db2inst1/sqllib/java"); System.setProperty("DB2TEMPDIR","/home/db2inst1/sqllib"); System.setProperty("INCLUDE","/home/db2inst1/sqllib/INCLUDE:/home/db2inst1/sqllib/lib");
> System.setProperty("LIB","/home/db2inst1/sqllib/lib"); System.setProperty("java.library.path","/opt/IBM/db2/V8.1/lib"); System.out.println(System.getProperty("DB2_JDBC_DR IVER_PATH")); System.out.println(System.getProperty("java.librar y.path"));
>
> ... results that error:
>
> /home/db2inst1/sqllib/java
> /opt/IBM/db2/V8.1/lib
> java.sql.SQLException: java.lang.UnsatisfiedLinkError: Can't find
> library db2jdbc (libdb2jdbc.so) in java.library.path
> java.library.path=/opt/IBM/db2/V8.1/lib
> at COM.ibm.db2.jdbc.app.DB2Driver.<init>(Unknown Source)
> at java.lang.Class.newInstance0(Native Method)
> at java.lang.Class.newInstance(Class.java:262)
> at os400tolinux.daten.<init>(daten.java:42)
> at os400tolinux.daten.main(daten.java:58)
>
> someone able to tell me what to do to get it work?
> thx
W Gemini Guest
-



Reply With Quote

