X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.192]) by svr1.postgresql.org (Postfix) with ESMTP id EB522CCA8C for ; Thu, 17 Jul 2003 17:04:43 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (svr4.postgresql.org [64.117.224.192]) (amavisd-new, port 10024) with ESMTP id 14684-05 for ; Thu, 17 Jul 2003 17:05:12 +0000 (GMT) Received: from phoenix.ritterdosreis.br (wall.ritterdosreis.br [200.198.106.115]) by svr1.postgresql.org (Postfix) with ESMTP id 38862CCA84 for ; Thu, 17 Jul 2003 14:04:42 -0300 (ADT) Received: from desenv1.ritterdosreis.br (cardinal.ritterdosreis.br [192.168.1.3]) by phoenix.ritterdosreis.br (Postfix) with SMTP id 917F239C55B; Thu, 17 Jul 2003 13:59:03 -0300 (BRT) Date: Thu, 17 Jul 2003 14:01:10 -0300 From: Felipe Schnack To: Dmitry Tkach Cc: Rich Cullingford , pgsql-jdbc@postgresql.org Subject: Re: setFetchSize() Message-Id: <20030717140110.52ca5fe2.felipes@ritterdosreis.br> In-Reply-To: <3F16D677.3010300@openratings.com> References: <3F16D2C9.3010808@sysd.com> <3F16D677.3010300@openratings.com> Organization: Ritter dos Reis X-Mailer: Sylpheed version 0.9.3claws2 (GTK+ 1.2.10; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200307/93 X-Sequence-Number: 7477 Seems to me like a quite good solution! But why this is needed when autoc= ommit is off? I can't understand. On Thu, 17 Jul 2003 13:01:43 -0400 Dmitry Tkach wrote: > Rich Cullingford wrote: >=20 > > All, > > Will this function be implemented in Release 7.4? I have several arge= =20 > > tables that run Java out of memory when I attempt to load them through= =20 > > JDBC. Any workarounds arppreciated... >=20 > I was using cursors for a while as a workaround... > Something like this: >=20 > c.setAutocommit (false); > Statement s =3D c.createStatement (); > s.execute ("declare foo cursor for select * from bar"); >=20 > while (true) > { > ResultSet rs =3D s.executeQuery ("fetch 10 from foo"); > int count =3D 0; > while (rs.next ()) > { > count++; > doStuffWithThisRow (rs); > } >=20=20=20=20=20=20 > if (count < 10) //The whole cursor contents has been processed > break; > } >=20=20=20=20 >=20=20=20=20 > I hope, it helps... >=20 > Dima >=20 >=20 >=20 > ---------------------------(end of broadcast)--------------------------- > TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org --=20 /~\ The ASCII Felipe Schnack (felipes@ritterdosreis.br) \ / Ribbon Campaign Analista de Sistemas X Against HTML Cel.: 51-91287530 / \ Email! Linux Counter #281893 Centro Universit=E1rio Ritter dos Reis http://www.ritterdosreis.br ritter@ritterdosreis.br Fone: 51-32303341