Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2003
    Posts
    3

    Unanswered: DB2 java SP unsatisfiedLinkError

    I am running db2 java store procedure examples on win2k with jdk1.3 and db2 v7.2.

    I follow such steps:
    // (1) create and populate the SAMPLE database (db2sampl)
    // (2) compile Spserver (javac Spserver.java)
    // (3) copy Spserver.class to the sqllib/function directory
    // (4) register the stored procedures using the Spcreate.db2 CLP script:
    // (i) db2 connect to sample
    // (ii) db2 -td@ -vf Spcreate.db2
    // (3) compile Spclient (javac Spclient.java)
    // (4) run Spclient (java Spclient)

    But when I run Spclient, at CallableStatement callStmt = con.prepareCall(sql), the application crashed with this message:
    Exception in thread "main" java.lang.UnsatisfiedLinkError: SQLAllcStmt
    at Com.ibm.db2.jdbc.app.DB2statement.SQLAllocStmt(nat ive method)...

    I checked in control center and find all the store procedure there. I also checked sqllib\bin\db2jdbc.dll, its size is 50k.


    I then go through the same procedure on a Linux machine and get a similar exception:
    java.lang.NullPointerException at Com.ibm.db2.jdbc.app.DB2preparedStatement.execute2 ...

    ANyone could help me please?

    Thanks

  2. #2
    Join Date
    Apr 2002
    Posts
    188

    Re: DB2 java SP unsatisfiedLinkError

    Originally posted by chunbo
    I am running db2 java store procedure examples on win2k with jdk1.3 and db2 v7.2.

    I follow such steps:
    // (1) create and populate the SAMPLE database (db2sampl)
    // (2) compile Spserver (javac Spserver.java)
    // (3) copy Spserver.class to the sqllib/function directory
    // (4) register the stored procedures using the Spcreate.db2 CLP script:
    // (i) db2 connect to sample
    // (ii) db2 -td@ -vf Spcreate.db2
    // (3) compile Spclient (javac Spclient.java)
    // (4) run Spclient (java Spclient)

    But when I run Spclient, at CallableStatement callStmt = con.prepareCall(sql), the application crashed with this message:
    Exception in thread "main" java.lang.UnsatisfiedLinkError: SQLAllcStmt
    at Com.ibm.db2.jdbc.app.DB2statement.SQLAllocStmt(nat ive method)...

    I checked in control center and find all the store procedure there. I also checked sqllib\bin\db2jdbc.dll, its size is 50k.


    I then go through the same procedure on a Linux machine and get a similar exception:
    java.lang.NullPointerException at Com.ibm.db2.jdbc.app.DB2preparedStatement.execute2 ...

    ANyone could help me please?

    Thanks

    Chunbo,

    I have seen this error when the you have different JDBC drivers, specially if you have not updated to JDBC type 2 drivers (UDB/DB2 v7.1 - 7.2) try updating to the type 2 drivers .

    you will find this on your sqllib/java12 directory with the name usejdbc2 I beleive

    my 2 cents

    marcos oliva

  3. #3
    Join Date
    Feb 2002
    Location
    Germany
    Posts
    141
    ... and don't forget to stop DB2 before issuing usejdbc2.bat!
    Rodney Krick

Posting Permissions

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