• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

How to call stored procedures in ejb2.1?

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have already put this in JBoss forum but i have not got any answer
"I have been asked to use stored procedures,i have used ejb-ql and jboss-ql but i don't know how i can call a stored procedure in my ejb and what will i write in ejb-jar and jbosscmp-jdbc xml file."
 
Ranch Hand
Posts: 208
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't know jboss, but to my knowledge ejb-ql does not support stored procedures. You need to use PreparedStatement and execute the stored procedure as you would an SQL-query.

for instance

 
RajendraKr Kumar
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Adne Brunborg ,
Thanks for your answer, but i am using CMP only, so how can i call stored procedure using CMP.
 
Ådne Brunborg
Ranch Hand
Posts: 208
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can't. Sorry.

Had exactly the same situation just one month ago. Company Policy is to use CMP only and no PreparedStatement. But when it became neccesary to call a stored procedure, this had to change.

Bottom line is, don't get too hung up in "using CMP only". Entity beans have their limitations, and this is one of them. Entity beans can't use business logic in the persistent store (i.e. database).

I am assuming you call your CMP beans from a SessionBean, right?
[ March 23, 2006: Message edited by: �dne Brunborg ]
 
ranger
Posts: 17346
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I have already put this in JBoss forum but i have not got any answer



Did you delete the one in JBoss? Nope, I closed that one. Please don't duplicate post. While JBoss really wasn't the right forum for the question, usually the bartender will move it to the correct forum, but didn't get a chance at that point. If that happens again, you can delete your original thread by clicking on the edit icon, then there is a check box on the next page to delete the post. When you delete and it is the post that is the thread starter, then the whole thread will be deleted, which is what you want in that case.

Mark
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic