pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Stefano B. <stefano.bonnin@comai.to>
To: pgsql-jdbc@postgresql.org
Subject: JTable and ResultSet TableModel with big resultset
Date: Fri, 27 Oct 2006 08:57:23 +0200
Message-ID: <004001c6f995$29cc8370$0501a8c0@comai04> (raw)

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

view thread (2+ messages)  latest in thread

Message-ID: <004001c6f995$29cc8370$0501a8c0@comai04>
Permalink:  ../004001c6f995$29cc8370$0501a8c0@comai04/
Also on:    postgresql.org/message-id/004001c6f995$29cc8370$0501a8c0@comai04

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: stefano.bonnin@comai.to
  Subject: Re: JTable and ResultSet TableModel with big resultset
  In-Reply-To: <004001c6f995$29cc8370$0501a8c0@comai04>
  References: <004001c6f995$29cc8370$0501a8c0@comai04>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox