If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Cannot get SQLJ.install_jar to work via JDBC

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-30-11, 14:12
tarr tarr is offline
Registered User
 
Join Date: Sep 2011
Posts: 2
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.
Reply With Quote
  #2 (permalink)  
Old 09-30-11, 14:42
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
Reply With Quote
  #3 (permalink)  
Old 09-30-11, 16:22
tarr tarr is offline
Registered User
 
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!!
Reply With Quote
Reply

Tags
db2, jdbc, sqlj.install_jar

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On