I write a report servlets (employee report) Name SSN Birthdate Mary 12345789 12/05/1970 ... etc I like to write some delete servlet with checkbox(delete) ,for every row in the table this is to choice for example first, or third employee record to delete. checkbox Name SSN Birthdate x Mary --- ------- for example I click the checkbox in this row because I like to delete this Name,SSN,Birthdate. It's possible somebody to help me to write some code for this problem. This is for practice , because I study servlets. Thanks.
Yes its possible to do that After you check a name to be deleted from the database you need to click a submit button to invoke a servlet In the delete servlet read the values from the checkbox which has the 'checked' value as true, I hope it is checked ..Refer HTML read the value from that checkbox in your form and execute appropriate sql statement to delete the chosen record like Delete from Employee where name='<the value chosen from the checkbox>' This would be same as deleting mails from your inbox in yahoo or hotmail Regards
Take up computer programming as fun and you will just enjoy it. Always keep in mind that in some way your program is going to make human life easier.
Hi Janet Don't know how much this will help you but try it out.
Joined: Nov 26, 2000
You can run the servlet when you have the connecting servlets ready, else will give you errors as it calls 2 servlets. One for picking up login information Two for transfering the control to the Delete option In the delete servlet you can write the code to receive the list and using StringTokenizer can take the number parse it to an int and check with the record in resultset and delete. Regards Suneel
Originally posted by Suneel Setlur: [B]Don't know how much this will help you but try it out.
A note of warning: with all these static resources sitting there, this servlet is not threadsafe! It should implement SingleThreadModel or your application will collapse in a big heap as soon as it gets a serious load. - Peter