Assistance with SP

Jay Huffman

Assistance with SP
Okay -

So I added the curly braces - still get same error -

try {

Class.forName(myDriver).newInstance();

db2Conn = DriverManager.getConnection (DBCONN, USER, PASWD);

st = db2Conn.createStatement();



String tmp_proc = "Call SIMPLE1(10,?)";

CallableStatement cStmt = db2Conn.prepareCall("{CALL SIMPLE1(10,?)}");



cStmt.registerOutParameter (1, Types.INTEGER);

cStmt.setString(1,result);



System.out.println("After the prepareCall statement ......");

cStmt.execute();

System.out.println("After the execute statement ......");



Still get error ==>

java call_sp1 TST

The DataBase passed was: TST

wdc-reglp08

While loop result :=|wdc-reglp08|

result is: null

DBCONN is: jdbc:db2:TST

After the prepareCall statement ......

COM.ibm.db2.jdbc.DB2Exception: [IBM][CLI Driver][DB2/6000] SQL0444N Routine
"SIMPLE1" (specific name "SQL051220075223440") is implemented with code in
library or path ".../sqllib/function/SIMPLE1", function "SIMPLE1" which
cannot be accessed. Reason code: "4". SQLSTATE=42724

at COM.ibm.db2.jdbc.app.SQLExceptionGenerator.throw_SQLException(
SQLExceptionGenerator.java:275)

at COM.ibm.db2.jdbc.app.SQLExceptionGenerator.throw_SQLException(
SQLExceptionGenerator.java:217)

at COM.ibm.db2.jdbc.app.SQLExceptionGenerator.check_return_code(
SQLExceptionGenerator.java:449)

at COM.ibm.db2.jdbc.app.DB2PreparedStatement.execute2(
DB2PreparedStatement.java:2199)

at COM.ibm.db2.jdbc.app.DB2PreparedStatement.execute(
DB2PreparedStatement.java:3975)

at call_sp1.RuneMe(call_sp1.java:142)

at call_sp1.run(call_sp1.java:58)

at call_sp1.main(call_sp1.java:50)

The query took: 704 millisends to execute.




--
Thanks for your assistance,
*****************************************
*** Jay Huffman
*** "Learn All That Is Learnable"
*****************************************

---------------------------------------------------------------------------------
Welcome to the DB2 User Group - Central Pennsylvania list. To unsubscribe, go to the archives and home page at http://www.idugdb2-l.org/archives/DB2-UG-Central-PA.html. From that page select "Join or Leave the list". The IDUG Listserv FAQ is at http://www.idugdb2-l.org. The DB2 User Group - Central PA List Admins can be reached at [login to unmask email] Find out the latest on IDUG conferences at http://conferences.idug.org/index.cfm