File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Object Relational Mapping and the fly likes Executing Stored Procedures Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Executing Stored Procedures" Watch "Executing Stored Procedures" New topic
Author

Executing Stored Procedures

sarmaP lolla
Greenhorn

Joined: Feb 01, 2009
Posts: 18
Srinivas,

We are planning to migrate a legacy application from Oracle forms to Java/J2EE and we are planning to use Hibernate with Spring. We have lots of existing stored procedures. Is there a nice way to call these stored procedures from Java code? Also these stored procedures might return a cursor. How to implement these? Can your book deals with these?

Thanks,
Sarma
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336


We have lots of existing stored procedures

This to me is a really good reason not to use an ORM. If you are already tied into one particular database type what benefit do you get from ORMs?


Is there a nice way to call these stored procedures from Java code? Also these stored procedures might return a cursor.

From Java, yes. You can use all the featrues of the Oracle JDBC driver (again, you are tied into Oracle, so you may as well use the extra stuff their driver gives you). Hibernate can call stored procedures, but carries the caveat that the stored procedure needs to return a ResultSet as the first out parameter.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Executing Stored Procedures