From: Nelson Arapé <narape@ica.luz.ve>
To: pgsql-jdbc@postgresql.org
Subject: Re: process large tables
Date: Thu, 14 Apr 2005 16:50:21 -0400
Message-ID: <200504141650.21673.narape@ica.luz.ve> (raw)
In-Reply-To: <OFBBAE2FE3.1E21A457-ON85256FE3.0070B08F-85256FE3.007154DC@nanometrics.ca>
References: <OFBBAE2FE3.1E21A457-ON85256FE3.0070B08F-85256FE3.007154DC@nanometrics.ca>
From the documentation
(http://jdbc.postgresql.org/documentation/80/query.html#query-with-cursor)
"By default the driver collects all the results for the query at once. This
can be inconvenient for large data sets so the JDBC driver provides a means
of basing a ResultSet on a database cursor and only fetching a small number
of rows.
..."
With a cursor you fetch rows by pieces. It is well explained in the
documentation.
Bye
Nelson Arapé
El Jue 14 Abr 2005 16:37, Kristina Magwood escribió:
> Hi,
> I am trying to process a large table. Unfortunately, using select * from
> table gives me a ResultSet that is too large.
> The java runs out of memory even if I boost the vm memory.
> Is there any way I can programmatically (in java) retrieve say 10,000
> records at a time without knowing anything specific about the table? Then,
> when I am done with those records, retrieve the next 10,000, etc?
>
> Thank you in advance for any help you can spare.
> Kristina
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: narape@ica.luz.ve
Subject: Re: process large tables
In-Reply-To: <200504141650.21673.narape@ica.luz.ve>
References: <OFBBAE2FE3.1E21A457-ON85256FE3.0070B08F-85256FE3.007154DC@nanometrics.ca> <200504141650.21673.narape@ica.luz.ve>
* 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