• 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
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

how to i delete the record from table ?

 
Ranch Hand
Posts: 834
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi, i have plenty of rows' record, which generated from user keyin data after user click on "add" button, and using ArrayList and HttpServletRequest

my doubt is , after the table record display , how to i delete certain row of record ? and also, if the records first column with the unique sequence number indication, when second record deleted , how the following number match back ? means initial third record with sequence number "3" now become "2" instead due to second record deleted ...

should i hv checkbox or just delete button beside of every single row for deletion, which one is better idea in sense of easier maintenance and coding

anyone mind to guide me on this ? thank you very much for guiding
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Whether you use a checkbox or individual delete buttons is really a matter of your choice. Checkboxes would allow you to delete several records together, though.
As to identifying the records to be deleted, you need be able to reconstruct the database primary key from the infomation you submit to your servlet. Assuming you have a non-composite integer key, you can use that as the name of the checkbox.
 
Alvin chew
Ranch Hand
Posts: 834
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi, Ulf Dittmer , when user click "add" button for record adding, the record is not yet insert into database, which is temporary data ..
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
For new data you don't need a key to insert into the database, as the DB will usually auto-generate it for you. So you can give the input fields generic names which your servlet can use to retrieve their values.
 
reply
    Bookmark Topic Watch Topic
  • New Topic