Win a copy of The Way of the Web Tester: A Beginner's Guide to Automating Tests this week in the Testing forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

From change in JTable to write to database

Daan Heuvelbeuk
Ranch Hand
Posts: 67
MySQL Database Netscape Windows XP
  • Mark post as helpful
  • send pies
  • 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?
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic