Author
How to call stored procedure in JDBC
Mike Dafel
Greenhorn
Joined: Jul 12, 2001
Posts: 10
Hello, I am trying to call a procedure GET_VAL which returns several "double" values. This procedure has one input parameter that specifies the number of values to be returned. Can anybody help me with a code snippet to make that possible, please. Thank you very much.
zou xiao fei
Greenhorn
Joined: Oct 26, 2001
Posts: 9
posted Mar 28, 2002 20:55:00
0
CallableStatement check jdk doc to find how to use it
Rajakumar Makapur
Greenhorn
Joined: Jun 23, 2001
Posts: 13
Hi, Hope this will help u Here the procedure takes 4 integers as parameters CallableStatement cStmt = null; try { cStmt = conn.prepareCall(" { call <proc name>(?,?,?,?)}"); cStmt.setInt(1,<varname1> ; cStmt.setInt(2,<varname2> ; cStmt.setInt(3, <varname3> ; cStmt.setInt(4, <varname4> ; cStmt.executeUpdate(); } catch(Exception e){ e.printStackTrace(); } // end of the try-catch block finally{ try { cStmt.close(); conn.close(); } catch(Exception e){} } // end of the finally block regards Raja
subject: How to call stored procedure in JDBC