Hi, I have a question about JTable and a ResultSet TableModel.
I have to develop a swing JTable application that gets the data from a ResultSetTableModel where the user can update the jtable data.
The problem is the following:
the JTable have to contain the whole data of the source database table. Currently I have defined a
a TYPE_SCROLL_SENSITIVE & CONCUR_UPDATABLE statement.
The problem is that when I execute the query the whole ResultSet is "downloaded" on the client side application (my jtable) and I could receive (with big resultsets) an "out of memory error"...
I have investigate about the possibility of load (in the client side) only a small subset of the resultset but with no luck. In the maling lists I see that the only way to load the resultset incrementally is to define a forward only resultset with autocommit off, and using setFetchSize(...). But this solution doesn't solve my problem because if the user scrolls the entire table, the whole resultset will be downloaded...
In my opinion, there is only one solution:
- create a small JTable "cache structure" and update the structure with "remote calls" to the server ...
in other words I have to define on the server side a "servlet environment" that queries the database, creates the resultset and gives to the jtable only the data subsets that it needs... (alternatively I could define an RMI client/server distribuited applications...)
This is my solution, somebody can help me?
Are there others solutions for my problem?
Thanks in advance,
Stefano