Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

update from database

 
abhijeet nagare
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello guys
i m building a swing app.
in that i m putting a table from database , but if any operation(like delete,insert) is occurring on that table is not showing to front-end immediatly . i have run that program again. is there solution for it.?
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch.

The JTable, like almost all JComponents, follows the MVC pattern and is not aware of the data it displays, but relies on the backing model to obtain the data.
Typically you would populate the model data with data from the DB. However, this does not mean your data model and DB are implicitly synched. You need to make sure that any DB change, updates your table model as well.
Recommended reading: http://docs.oracle.com/javase/tutorial/uiswing/components/table.html
 
There's a way to do it better - find it. -Edison. A better tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!