From: ray_amit@vsnl.net
To: pgsql-jdbc@postgresql.org
Subject: JDBC Rowsets running out of memory when dealing with large tables
Date: 26 Jul 2004 02:35:38 -0700
Message-ID: <8f5b0ade.0407260135.5150c3de@posting.google.com> (raw)
Hello,
The following code doesn't work for SELECT query on very large tables
:
...
import javax.sql.RowSet;
import oracle.jdbc.rowset.OracleJDBCRowSet;
....
RowSet rowset = new OracleJDBCRowSet();
rowset.setUsername(username);
rowset.setPassword(password);
rowset.setUrl(url);
rowset.setConcurrency(ResultSet.CONCUR_UPDATABLE);
rowset.setCommand();
rowset.execute();
while ( rowset.next() )
{
// These variables have been declared earlier
callType = rowset.getString("CALL_TYPE");
otherNumber= rowset.getString("OTHER_NUMBER");
timestamp = rowset.getTimestamp("CHARGING_TIMESTAMP");
volume = rowset.getInt("VOLUME");
rowset.updateFloat("CHARGE", volume * 0.50);
rowset.updateRow();
}
// Closing the DB connection.
rowset.close();
...
The jars used : ojdbc14.jar, ocr12.zip, ocr12.jar comes along with
Oracle 9i.
It runs out of memeory when I try to execute it on a large table. Is
it because the rowset is trying to cache the entire resultset in
memory? From practical requirements point a view neither can I
guarantee that the data would be lesser than permitted by the m/c's
main memory on which it will be implemented nor the actual table can
be split up into chunks.
Is there any other way out ? Please reply asap.
Amit Ray.
http://www.go4expert.com/forums/
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: ray_amit@vsnl.net
Subject: Re: JDBC Rowsets running out of memory when dealing with large tables
In-Reply-To: <8f5b0ade.0407260135.5150c3de@posting.google.com>
References: <8f5b0ade.0407260135.5150c3de@posting.google.com>
* 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