Results 1 to 5 of 5
  1. #1
    Join Date
    Feb 2002
    Posts
    6

    Unanswered: java.lang.UnsatisfiedLinkError when running JDBC app

    Hi,
    I'm running a simple JDBC app on NT4.0. It make a connection to a database using DB2DataSource and tries to do a simple select statement. I get a runtime error when the following line of code is executed:

    PreparedStatement stmt = conn.prepareStatement("SELECT ID FROM EMP");

    Here is the runtime error.

    Exception in thread "main" java.lang.UnsatisfiedLinkError: SQLPrepare
    at COM.ibm.db2.jdbc.app.DB2PrepareStatement.
    <init><DB2PreparedStatement.java:409>
    at COM.ibm.db2.jdbc.app.DB2PrepareStatement.
    <init><DB2PreparedStatement.java:469>
    at COM.ibm.db2.jdbc.app.DB2Connection.prepareStatemen t
    <DB2Connection.java:512> at selectapp.main<selectapp.java:107>

    It seems to be a classpath issue, however, I'm clueless as to why it is throwing this error. I'm certain I have all the necessary jar and zip files in the classpath and the dll files in the sqllib\bin dir.

    Please advice. Thanks.
    Julio

  2. #2
    Join Date
    Feb 2002
    Posts
    7

    set the classpath correctly

    Hi,
    this is due to that the JRE could not identify the required class in the classpath..
    you can exrtact the db2java.zip available inside ../java folder with the "use folder option" checked.. and then set the classpath to the base folder.
    hope it helps..

    -arun

  3. #3
    Join Date
    Oct 2002
    Posts
    1
    Hi Julio,
    What was the final resolution to your "UnsatisifedLinkError: SQLPrepare" problem? I am getting the same problem. I do have C:\Progra~1\SQLLIB\bin in my PATH and I have db2java.zip in my classpath. I have even tried to unzip db2java.zip and use the folder in my classpath. It still doesn't work.

    Venkat

  4. #4
    Join Date
    Apr 2002
    Posts
    188

    Re: java.lang.UnsatisfiedLinkError when running JDBC app

    Originally posted by jsolis33
    Hi,
    I'm running a simple JDBC app on NT4.0. It make a connection to a database using DB2DataSource and tries to do a simple select statement. I get a runtime error when the following line of code is executed:

    PreparedStatement stmt = conn.prepareStatement("SELECT ID FROM EMP");

    Here is the runtime error.

    Exception in thread "main" java.lang.UnsatisfiedLinkError: SQLPrepare
    at COM.ibm.db2.jdbc.app.DB2PrepareStatement.
    <init><DB2PreparedStatement.java:409>
    at COM.ibm.db2.jdbc.app.DB2PrepareStatement.
    <init><DB2PreparedStatement.java:469>
    at COM.ibm.db2.jdbc.app.DB2Connection.prepareStatemen t
    <DB2Connection.java:512> at selectapp.main<selectapp.java:107>

    It seems to be a classpath issue, however, I'm clueless as to why it is throwing this error. I'm certain I have all the necessary jar and zip files in the classpath and the dll files in the sqllib\bin dir.

    Please advice. Thanks.
    Julio
    Julio,

    This could happen when you have two different db2java.zip type files,
    use the jdbc2 type 2 files, in both your server and client and try again

    marcos oliva

  5. #5
    Join Date
    Oct 2002
    Location
    Greece
    Posts
    8
    Are you using the app or the net driver?

Posting Permissions

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