X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id E31F1D1B792 for ; Mon, 26 Jul 2004 06:47:14 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 72622-07 for ; Mon, 26 Jul 2004 09:47:16 +0000 (GMT) Received: from news.hub.org (news.hub.org [200.46.204.72]) by svr1.postgresql.org (Postfix) with ESMTP id 77D1CD1B775 for ; Mon, 26 Jul 2004 06:47:01 -0300 (ADT) Received: from news.hub.org (news.hub.org [200.46.204.72]) by news.hub.org (8.12.9/8.12.9) with ESMTP id i6Q9knqb028345 for ; Mon, 26 Jul 2004 09:46:57 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.12.9/8.12.9/Submit) id i6Q9ZcBw026753 for pgsql-jdbc@postgresql.org; Mon, 26 Jul 2004 09:35:38 GMT From: ray_amit@vsnl.net (Amit Ray) X-Newsgroups: comp.databases.postgresql.interfaces.jdbc Subject: JDBC Rowsets running out of memory when dealing with large tables Date: 26 Jul 2004 02:35:38 -0700 Organization: http://groups.google.com Lines: 54 Message-ID: <8f5b0ade.0407260135.5150c3de@posting.google.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Complaints-To: groups-abuse@google.com To: pgsql-jdbc@postgresql.org X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200407/287 X-Sequence-Number: 10671 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/