To much data for a ResultSet

From: ben(dot)suffolk(at)orange(dot)co(dot)uk
To: pgsql-jdbc(at)postgresql(dot)org
Subject: To much data for a ResultSet
Date: 2001-10-09 16:06:48
Message-ID: 80256AE0.00589F9A.00@ruddick
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc


Hello,

I am retrieveing a lot of data from a table and it results in a
java.lang.OutOfMemoryError and so I figured I need to make sure I don;t get all
the data from the database back in one go.

I have tried setting a cursorName and this does indeed only return the first
part of the data into the ResultSet. However I can not seem to find a way to
retrieve the remaining part of the data. I have tried using the following
command :-

if(select.getMoreResults())
rs = select.getResultSet();

However there are never are never any more ResultsSets avaliable.

Am I doing something wrong or are cursors not implemented in this version of the
JDBC drivers (jdbc7.1-1.2.jar)?

An obvious bodge for me (as the data in the database is not changing on a
regular basis) is to use LIMIT in the SELECT command, however I would rather do
it a nicer way than that!

Regards

Ben

*******************************************************************************
Important. This E-mail is intended for the above named person and may be
confidential and/or legally privileged. If this has come to you in error you
must take no action based on it, nor must you copy or show it to anyone; please
inform the sender immediately.
*******************************************************************************

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Barry Lind 2001-10-09 18:13:54 Re: To much data for a ResultSet
Previous Message Dave Cramer 2001-10-08 21:31:30 Re: [Fwd: Re: Serialize]