Hi , I need to execute a stored procedure in SQL Servver ... The problem is that i donĀ“t know how to register an out parameter to the stored procedure using Hibernate 3 . In JDBC using simple Callable statement The code would be: Connection con = session.connection(); 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(); In Case Hibernate's support for stored procedures does not cover out parameters then is their another way to fetch Connection Object as session.conncetion(); method is depricated in Hibernate 3
Regards, Mehak
|