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.