This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes How to use Table model to include database values Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "How to use Table model to include database values" Watch "How to use Table model to include database values" New topic
Author

How to use Table model to include database values

partha phukan
Ranch Hand

Joined: Mar 13, 2011
Posts: 31
Sir, please give me some suggestion regarding how to use table model to include database values. i have used metadata to include database values in a JTable, it is working fine and it display results without any error, but i have a problem in refreshing the JTable to include new datas.

Is it possible to refresh the JTable with new values without using table model? whether i have to change the using of metadata to retrieve data from database? is there any way. please give me some hints that how should i proceed..

Thanks in advance.
Rob Camick
Ranch Hand

Joined: Jun 13, 2009
Posts: 2157
    
    7
Is it possible to refresh the JTable with new values without using table model?


No. The table can only display data found in the table model.

You can use table.setValueAt(....) to change the data on a cell by cell basis.

Or you can use table.setModel(...) to change all the data at oonce.
partha phukan
Ranch Hand

Joined: Mar 13, 2011
Posts: 31
Thank you sir for your reply. But sir, is my way of of retrieving data from database need to be changed i.e i mean to say that whether the use of metadata need to be changed.
 
jQuery in Action, 2nd edition
 
subject: How to use Table model to include database values
 
Similar Threads
refreshing a JTable
JTable...
JTable(!!!)
Vector and JTable
jtable