• Post Reply Bookmark Topic Watch Topic
  • New Topic

JSP page Admin

 
Vitou Som
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
+-------------------------------------------------------------------------+
| ID | Name | Gender | DOB | Position || |
|--------------------------------------------------------------------------+
| 1 | ... | | | || Edit || Delete |
|--------------------------------------------------------------------------+
| 2 | ... | | | || Edit || Delete |
|--------------------------------------------------------------------------+
| 3 | ... | | | || Edit || Delete |
|--------------------------------------------------------------------------+

My table above is retrieved and shown from MySQL Database;
Question:
- I want to edit and delete data in Database by : when I click on a row or other row, It catches ID and load to other page or content to edit.
Whereas Delete, when I click on a row, It will delete from Database.
- How can I do these? Can you tell me how to use condition or some clues?
- Please help me.

Thank very much.
 
es kranthi
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use a Delete Button or an X- button to prompt the user to Delete.
The delete button needs to be fed with ID meaning the table row which should be deleted from DB.
This can be done by capturing the ID of that particular row.

write a Javascript function to call the Delete Method on the Server (Struts or Servlets) by passing this ID.
Pass this ID to DAO class and using some delete query delete the row in the DB.

Are you new to J2EE ?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!