Hi Hibernate devs ..<br><br>I need to execute a stored procedure in DB2 ...<br><br>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:
<br><br><span style="font-family: courier new,monospace; font-weight: bold;">String query = "{call P5PORC_CONSULTAR_CUPO_CLIENTE (?,?,?,?,?)}";</span><br style="font-family: courier new,monospace; font-weight: bold;">
<span style="font-family: courier new,monospace; font-weight: bold;">CallableStatement cstmt = con.prepareCall(query);</span><br style="font-family: courier new,monospace; font-weight: bold;"><span style="font-family: courier new,monospace; font-weight: bold;">
cstmt.setString(1, "1234");</span><br style="font-family: courier new,monospace; font-weight: bold;"><span style="font-family: courier new,monospace; font-weight: bold;">cstmt.registerOutParameter(2, Types.VARCHAR
);</span><br style="font-family: courier new,monospace; font-weight: bold;"><span style="font-family: courier new,monospace; font-weight: bold;">cstmt.registerOutParameter(3, Types.INTEGER);</span><br style="font-family: courier new,monospace; font-weight: bold;">
<span style="font-family: courier new,monospace; font-weight: bold;">cstmt.registerOutParameter(4, Types.VARCHAR);</span><br style="font-family: courier new,monospace; font-weight: bold;"><span style="font-family: courier new,monospace; font-weight: bold;">
cstmt.registerOutParameter(5, Types.VARCHAR);</span><br style="font-family: courier new,monospace; font-weight: bold;"><br style="font-family: courier new,monospace; font-weight: bold;"><span style="font-family: courier new,monospace; font-weight: bold;">
cstmt.executeUpdate();</span><br><br><br>Thanx ...<br><br>