Swing JTable and ResultSet TableModel (with big resultsets)

From: "Stefano B(dot)" <stefano(dot)bonnin(at)comai(dot)to>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Swing JTable and ResultSet TableModel (with big resultsets)
Date: 2006-10-27 09:29:25
Message-ID: 007001c6f9aa$64e120f0$0501a8c0@comai04
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi, I don't know if this is the right list for this question but I don't know where to ask...

I have a question about JTable and a ResultSet TableModel (using JDBC postgresql driver).

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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Purusothaman A 2006-10-27 09:31:09 Re: what is the default username password for PostgreSQL, which was installed with FC5.
Previous Message Ron Johnson 2006-10-27 09:28:09 Re: Reducing pg_dump & pg_restore times