• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JSP page Admin

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic