How do i call the the Stored procedure using Hibernate?

Questions by Srikanth Gambhir

Showing Answers 1 - 2 of 2 Answers

You can use callableStatement to call any procedure from the Hibernate but i prefer to use iBatis instead of Hibernate for performing these type of actions.

  Was this answer useful?  Yes

tecfinder

  • Mar 26th, 2010
 

There are two ways you can call stored procedure in hibernate


1) session.connection() will give you jdbc connection which you can use it to call callablestatement which you normally do in JDBC. Here you dont have to explicitly close the jdbc connection, hibernate will do it for you when you close the session.

2) You can call the stored procedure as named query using <sql-query name="storedprocedure name" callable="true"> tag .Details you can see at any hibernate site.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions