This week's book giveaway is in the Performance forum.
We're giving away four copies of The Java Performance Companion and have Charlie Hunt, Monica Beckwith, Poonam Parhar, & Bengt Rutisson on-line!
See this thread for details.
Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

EJB 3.0 call stored procedure

 
Srdjan Atanaskovic
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 100
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic