• 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

From change in JTable to write to database

 
Ranch Hand
Posts: 89
Netscape MySQL Database Windows XP
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have been searching, but have not found the answer. Is it a nifty feature of the DefaultTableModel?

What do you need to do to write a change (delete row, delete all rows, insert new row, change field value) to the database, AND update your JTable?

In my application I read time written on a project's activity from a database, create Project objects. For my application I get all records (Projects) between a Monday, and it's subsequent Sunday (week starts with Monday). I convert these Projects to my JTable using:


I add one method I now have finished. It finds the Project object that was selected by the user, removes the accompanying row from the database, and then removes the row from the JTable.


Is this the way to work, or am I not seeing that nifty feature from the DefaultTableModel that does all this work for me?
 
Sometimes you feel like a nut. Sometimes you feel like a tiny ad.
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic