wood burning stoves 2.0*
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
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
Author

EJB 3.0 call stored procedure

Srdjan Atanaskovic
Greenhorn

Joined: Mar 29, 2007
Posts: 3
Hi,

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
author
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

regards
Debu


Author: EJB 3 In Action (http://manning.com/panda)
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: EJB 3.0 call stored procedure
 
Similar Threads
How to call ENtity Bean from Message driven bean
How to call stored procedure from Entity Manager if there is out parameter in stored procedure.
Hibernate and Stored Procedure
Spring hibernate issue
Spring JdbcTemplate issue for calling stored procedure