Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Java and Stored Procedures

Status
Not open for further replies.

nicka3

Programmer
Sep 16, 2003
2
ES
Hello!!

How can I obtain out param of Procedure in DB2 from Java??
My code is:

ConnectDB DB = new ConnectDB();
CON = DB.getConnection();
String sRES = "";
String param = "12345678"

CallableStatement cs = null;
String sSQL = " CALL PROCEDURE('"+param+"',?)";
cs = CON.prepareCall(sSQL);
cs.registerOutParameter(1,Types.CHAR);
cs.execute();

sRES = cs.getString(1);

But I Have the exception:

java.lang.NoClassDefFoundError: com/ibm/db2/jcc/SQLJPackage
at COM.ibm.db2.jdbc.net.DB2Connection.prepareCall(DB2Connection.java:658)

Why??? I need help. Thank you.
 
>>>>> java.lang.NoClassDefFoundError: com/ibm/db2/jcc/SQLJPackage

Sounds like your problem is a CLASSPATH issue - it cannot find the indicated package and/or class ...
 

My application's running :) The problem was I have 'db2driver.jar' in the classpath, but I haven't included `db2jcc.jar' that is necesary for execute stored procedures with Callable Statement.

Thank you very muchhhhhhhhh...

(I'm sorry my English is very bad)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top