AlistairMonkeyFinger
Programmer
Hi,
I have a Swing app that has a JTable. I have a class that implements TableModel that queries a database then gets data by..
Now i want to filter my table upon user request but i'd like to do this ideally withou having to requery the database, has anyone any ideas ?
I guess one option would be do create a new recordset from the old one carrying out some kind of manual filter ? Or copying it row by row to an array doing a manual filter ?
Please let me know if you need any more info / code etc
TIA
I have a Swing app that has a JTable. I have a class that implements TableModel that queries a database then gets data by..
Code:
public Object getValueAt(int row, int column) {
try {
results.absolute(row+1); // Go to the specified row
Object o = results.getObject(column+1); // Get value of the column
if (o == null) return null;
else return o.toString(); // Convert it to a string
} catch (SQLException e) { return e.toString(); }
}
Now i want to filter my table upon user request but i'd like to do this ideally withou having to requery the database, has anyone any ideas ?
I guess one option would be do create a new recordset from the old one carrying out some kind of manual filter ? Or copying it row by row to an array doing a manual filter ?
Please let me know if you need any more info / code etc
TIA