aspose file tools*
The moose likes Object Relational Mapping and the fly likes About Hibernate Support for StoredProcedure Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "About Hibernate Support for StoredProcedure" Watch "About Hibernate Support for StoredProcedure" New topic
Author

About Hibernate Support for StoredProcedure

krishna bulusu
Ranch Hand

Joined: Aug 28, 2006
Posts: 185
Hi,
We are using Hibernate in our Project.
For calling Stored Procedure We are doing in the normal way like executing the Callable Statement.
I found that Hibernate 3 will support the Stored Procedures too.
Now, My question is which is the better option whether calling the stored procedures through Hibernate or Callable Statement?


Thanks&Regards, Krishna.
SCJP1.4, SCWCD1.4, SCBCD 5.0
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

You can call Stored Procedures through Hibernate. There are two caveats.

1. You can have only one out parameter and it must be the first parameter.
2. That out parameter should be a ref cursor, not custom datatypes allowed.

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
krishna bulusu
Ranch Hand

Joined: Aug 28, 2006
Posts: 185
Thanks Mark,

But, Which is Advantageous(Or In terms of Performance), calling through plain JDBC or calling through Hibernate?
And also, My Stored Procedure is returning a CLOB object. So, in such case, can I call the Stored Procedure through Hibernate?
[ July 27, 2007: Message edited by: krishna bulusu ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: About Hibernate Support for StoredProcedure
 
Similar Threads
Callable statement vs prepared statement
How resultset is returned by stored procedure?
Callable Statement
Unit testing StoredProcedure with HSQLDB
Calling stored procedures from hibernate