cancel
Showing results for 
Search instead for 
Did you mean: 

how to write delete query in ejb

former_member8655
Active Participant
0 Kudos

hi all

i wish to how to write <b>delete query</b> in ejb.

i am using data dictionaries as database.

i am able to save,and retrive data.

and i am using web services to use this method in web dynpro.

but i am not getting way,how and where to write delete query in EJB.

bye

Accepted Solutions (0)

Answers (2)

Answers (2)

Erin2
Advisor
Advisor
0 Kudos

Hi Mitesh,

If you are using CMP, you simply call the remove(Object primaryKey) method on the bean's home interface.

Thanks, Erin

guru_subramanianb
Active Contributor
0 Kudos

Hi Mitesh,

you can write delete query in the same method where you are saving and retrieving data in webdynpro.

General form of delete query is :-

SQL> Delete from table <table name> where <constraint>;

For eg :- delete from table emp where empsal>5000;

if you wish to commit after running the delete query just commit it.

If you use a CMP scenario use the ejbRemove() method to write your code for deleting.

Regards,

Guru