wood burning stoves 2.0*
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes Calling stored procedures from EJB using JPA, is this possible ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "Calling stored procedures from EJB using JPA, is this possible ?" Watch "Calling stored procedures from EJB using JPA, is this possible ?" New topic
Author

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

Meherdad Bomanbehram
Ranch Hand

Joined: May 28, 2007
Posts: 140

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

Joined: Nov 24, 2005
Posts: 14688
    
  16

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.


[My Blog]
All roads lead to JavaRanch
Meherdad Bomanbehram
Ranch Hand

Joined: May 28, 2007
Posts: 140

thanks a lot Christophe Verré we are using the oracle suite so hopefully will use these new annotations

Many Thanks
Jait Thomas
Ranch Hand

Joined: Jul 03, 2003
Posts: 31
Not sure whether EJB is an option if you want to call SP's. Have a look at iBatis.


Jait Thomas<br />SCJP 1.2, SCWCD, SCDJWS 1.4 & 5.0
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Calling stored procedures from EJB using JPA, is this possible ?