Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Calling stored procedures from EJB using JPA, is this possible ?

 
Meherdad Bomanbehram
Ranch Hand
Posts: 142
Java Netbeans IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All ,
Some of the projects that I am working on currently are built in client server tech making extensive use of Stored procedures .
Now since the company is moving to Java EE tech, is it possible to call those stored procedures from EJB's using JPA or do I require to use JDBC from EJB ? I need to call stored procedures as we will be moving some modules first and others later so in the interim require to keep the business logic still in the stored procedures .

Many thanks
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's not natively supported in JPA. I don't know if there's a better way than using JDBC's API.

There seem to be two new annotations for Oracle Toplink 11g (warning, this is container dependant) : @NamedStoredProcedureQuery and @NamedStoredProcedureQueries.
 
Meherdad Bomanbehram
Ranch Hand
Posts: 142
Java Netbeans IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks a lot Christophe Verré we are using the oracle suite so hopefully will use these new annotations

Many Thanks
 
Jait Thomas
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not sure whether EJB is an option if you want to call SP's. Have a look at iBatis.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic