Re: Swing JTable and ResultSet TableModel (with big resultsets)

From: John DeSoi <desoi(at)pgedit(dot)com>
To: Stefano B(dot) <stefano(dot)bonnin(at)comai(dot)to>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: Swing JTable and ResultSet TableModel (with big resultsets)
Date: 2006-10-28 14:54:51
Message-ID: DAE038A9-FD2F-4A6C-9C8F-0825366C8D17@pgedit.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Oct 27, 2006, at 5:29 AM, Stefano B. wrote:

> 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...

I don't use JDBC so maybe I don't understand the limitations. But
PostgreSQL supports cursors that can be scanned forward and
backwards. Using FETCH you can just get the data you need for the
display. See the DECLARE documentation:

http://www.postgresql.org/docs/8.1/interactive/sql-declare.html

John DeSoi, Ph.D.
http://pgedit.com/
Power Tools for PostgreSQL

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Alvaro Herrera 2006-10-28 17:40:41 Re: Mailing list problem?
Previous Message Robert Treat 2006-10-28 14:07:27 Re: CUBE, ROLLUP, GROUPING SETS?