• Post Reply Bookmark Topic Watch Topic
  • New Topic

update from database  RSS feed

 
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
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!