File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
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: 2227
    
    8
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to use Table model to include database values