Professional Web Applications Themes

Connect with Java to Linux DB2 - IBM 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 ...

  1. #1

    Default 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

  2. #2

    Default Re: Connect with Java to Linux DB2

    pico77 wrote:
    > 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
    Run db2profile under sqllib directory. It will setup the load path for you.

    W Gemini Guest

  3. #3

    Default Re: Connect with Java to Linux DB2

    Connect with Java to Linux DB2
    RANJNi Guest

Similar Threads

  1. Remote Java Web Service over HTTPS - How to Connect?
    By Darryl A. J. Staflund in forum Coldfusion - Advanced Techniques
    Replies: 7
    Last Post: August 4th, 11:12 AM
  2. Using Java CFX on Linux
    By craigkaminsky in forum Coldfusion - Advanced Techniques
    Replies: 0
    Last Post: July 26th, 10:25 PM
  3. Cannot connect to SQL 2k from MX7 (Linux)
    By Oblio in forum Coldfusion Server Administration
    Replies: 2
    Last Post: June 18th, 12:34 PM
  4. Replies: 2
    Last Post: September 9th, 06:19 PM
  5. Cannot Connect to some website on linux
    By ThanhVu Nguyen in forum Debian
    Replies: 7
    Last Post: July 29th, 11:20 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139