This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I want to delete record from oracle db, i need alert message saying 'Are you sure you want to delete?' with yes and no buttons, if yes, the data should delete if no control shd be in the same page(retrieve.jsp). I have no idea how to do this...the previous page is retrieve.jsp which has the data, based on form input with edit and Delete button end of each row, when i click delete it shd alert me....This is my servlet code:
There are couple of other things that you can improve even if you are doing example.
1) Do not embed HTML inside the DeleteData. Read about MVC2 and use JSP for that purpose. I guess you are already doing that in retrieve.jsp as you mentioned.
2) Close the database resources in finally block to make sure they are called even if you encounter exception in your code.