Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2011
    Posts
    2

    Unanswered: Cannot get SQLJ.install_jar to work via JDBC

    Hello,

    I am trying to get CALL SQLJ.install_jar to work via JDBC in DB2 V9.7 Windows XP. I can get this call working just fine via a DB2 command line:

    Call sqlj.install_jar('file:/temp/myjar.jar', 'myjar');

    But I can't get this working in JDBC with either type 2 or type 4 driver; it gives me DB2 SQL Error: SQLCODE=-440, SQLSTATE=42884, SQLERRMC=SQLJ.INSTALL_JAR;PROCEDURE, DRIVER=4.7.85

    This is the code that's failing:

    String sql = "{Call sqlj.install_jar(?, ?)}";
    PreparedStatement stmt = db2Connection.prepareCall (sql);
    // set all parameters (input and output)
    stmt.setString( 1, "file:/temp/myjar.jar" );
    stmt.setString( 2, "myjar" );
    stmt.execute();

    I've also tried it with 3 parameters, as I've seen reports elsewhere that this may be needed:

    String sql = "{Call sqlj.install_jar(?, ?, ?)}";
    PreparedStatement stmt = db2Connection.prepareCall (sql);
    // set all parameters (input and output)
    stmt.setString( 1, "file:/temp/myjar.jar" );
    stmt.setString( 2, "myjar" );
    stmt.setInt( 3, 0 );
    stmt.execute();

    But no joy.

    Any help would be GREATLY appreciated! Thanks so much in advance.

  2. #2
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1

  3. #3
    Join Date
    Sep 2011
    Posts
    2

    thank you!

    Thanks SO much--I searched for many hours without finding that information. I REALLY appreciate your help!!

Tags for this Thread

Posting Permissions

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