[hibernate-dev] Register Out Parameters in a Stored Procedure

David Borja adborja at gmail.com
Tue Jun 26 10:49:18 EDT 2007


Hi Hibernate devs ..

I need to execute a stored procedure in DB2 ...

The problem is that i don´t know how to register an out parameter to the
stored procedure. With simple Callable statement would be something like:

String query = "{call P5PORC_CONSULTAR_CUPO_CLIENTE (?,?,?,?,?)}";
CallableStatement cstmt = con.prepareCall(query);
cstmt.setString(1, "1234");
cstmt.registerOutParameter(2, Types.VARCHAR);
cstmt.registerOutParameter(3, Types.INTEGER);
cstmt.registerOutParameter(4, Types.VARCHAR);
cstmt.registerOutParameter(5, Types.VARCHAR);

cstmt.executeUpdate();


Thanx ...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/hibernate-dev/attachments/20070626/5e35dd4c/attachment.html 


More information about the hibernate-dev mailing list