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."
Ådne Brunborg
Ranch Hand
Joined: Aug 05, 2005
Posts: 208
posted
0
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
Entia non sunt multiplicanda praeter necessitatem
RajendraKr Kumar
Greenhorn
Joined: Mar 17, 2006
Posts: 6
posted
0
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
Joined: Aug 05, 2005
Posts: 208
posted
0
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 ]
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.