Re: How can I update a JTable with a new ResultSet?
Posted By:
Morten_Sjoegren
Posted On:
Friday, October 4, 2002 11:43 AM
You have extract each attribut from each post one at a time, and put them into the JTable.
You've to use a "while" or a "for" :
ResultSet rs = stmt.executeQuery(SQLString); // stmt is a Statement
while (rs.next())
{
attribut_name1 = rs.getXXX(); // Replace XXX with varible type like int or String
JTable_name.setValueAt(attribut_name1, row_number, column_number);
}
I hope you get the idea
Remember, if you have data in the JTable you have to create it from new.