File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes EJB and other Java EE Technologies and the fly likes EJB 3.0 call stored procedure Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "EJB 3.0 call stored procedure" Watch "EJB 3.0 call stored procedure" New topic

EJB 3.0 call stored procedure

Srdjan Atanaskovic

Joined: Mar 29, 2007
Posts: 3

I am working on new project which should be done using EJB 3.0 and persistence.
I have to use stored procedures that are already written, and I am wondering is there a way to call stored procedure using persistence.
I know how to call procedure without persistence.
Any help is valuable.

Thanks in advance.
Debu Panda
Ranch Hand

Joined: Jan 21, 2007
Posts: 100
JPA does not support stored procedure. However you can work around by converting your stored procedures to stored functions. However it is expected that some JPA providers will provide their extensions to use stored procedures. If I remember from the discussion in the EG, it will be addressed in JPA 2.0.

And call the stored functions in a Nattive Query e.g. you have a stored function name calculate with two in parameters and return floating type.

You call that select calcuate(x,y) from dual in native query


Author: EJB 3 In Action (
I agree. Here's the link:
subject: EJB 3.0 call stored procedure
It's not a secret anymore!