Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Executing Stored Procedures

 
sarmaP lolla
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic