Results 1 to 4 of 4
- 10-25-2011, 02:48 AM #1
Member
- Join Date
- Jul 2011
- Posts
- 76
- Rep Power
- 0
JTableModel and Relation Database
I am learning how to use JTables. I have learned how to pass static content into the jTable constructor to populate it. I now want to use the AbstactTableModel class and the resultSet from mysql database to populate the table but i don't have a clue how to implement it can somebody help me. I already know how to use the getColumnCount, getRowCount and getColumn methods but i am not that clear on getValueAt method. I know that it's the getValueAt method that is used to populate the table but not how to use it with sql. And another question i have is if i was to use the AbstractTableModel class with and sucessively set it up with mysql database if i was to make any change to the data within the database would it automatically update the table
- 10-25-2011, 06:23 AM #2
Senior Member
- Join Date
- Jul 2009
- Posts
- 1,143
- Rep Power
- 5
Re: JTableModel and Relation Database
See: Table From Database « Java Tips Weblog for some ideas. The TableFromDatabaseExample code would be the best place to start to better help you understand how TableModels work.
- 10-25-2011, 10:13 AM #3
Member
- Join Date
- Oct 2011
- Posts
- 1
- Rep Power
- 0
Re: JTableModel and Relation Database
Data will be automatically updated every time you refresh the page/or table.
If you want immediate effect of data change, means whenever the data is changed in the database, immediately the front end will be updated. To implement this, we have to put some extra effort like implementing listeners.
- 10-25-2011, 09:33 PM #4
Moderator
- Join Date
- Jul 2010
- Location
- California
- Posts
- 1,606
- Rep Power
- 5
Similar Threads
-
relation between J2EE and J2ME
By Cosmos in forum Forum LobbyReplies: 4Last Post: 07-21-2011, 06:57 PM -
Funny Abstract Relation Name in JPA:What Does That Mean?
By mbaocha in forum Enterprise JavaBeans (EJB)Replies: 1Last Post: 11-16-2009, 07:22 AM -
Changing JTableModel does not change JScrollpane size
By stelzergil in forum New To JavaReplies: 3Last Post: 10-19-2009, 02:14 AM -
Relation between 2 views
By tojas in forum SWT / JFaceReplies: 0Last Post: 04-19-2009, 03:22 AM -
Relation between Polymorphism and Inheritance
By janakiram.attuluri in forum Advanced JavaReplies: 1Last Post: 12-26-2007, 11:32 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks