X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 44707D1D27B for ; Tue, 11 May 2004 17:34:02 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 21643-10 for ; Tue, 11 May 2004 17:33:43 -0300 (ADT) Received: from mail1.yozons.com (mail1.yozons.com [206.80.109.179]) by svr1.postgresql.org (Postfix) with ESMTP id CC465D1D2E6 for ; Tue, 11 May 2004 17:33:40 -0300 (ADT) Received: from rasta (soho2.yozons.com [206.80.109.178] (may be forged)) (authenticated bits=0) by mail1.yozons.com (8.12.8/8.12.8) with ESMTP id i4BKXf01000672 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NOT); Tue, 11 May 2004 13:33:41 -0700 Message-ID: <036601c43797$4312ee40$3201a8c0@rasta> Reply-To: "David Wall" From: "David Wall" To: Cc: References: <20040511103520.1ADC6D1B1EE@svr1.postgresql.org> <40A0CB55.5060400@opencloud.com> <024101c4376d$d567d050$3201a8c0@rasta> <1084305394.1534.121.camel@localhost.localdomain> Subject: Re: JDBC and processing large numbers of rows Date: Tue, 11 May 2004 13:32:29 -0700 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1409 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200405/59 X-Sequence-Number: 10069 > Use cursors to page through really large result sets Well, I've thought about that, but that just led me to my 3rd question in my previous inquiry: > > 3) How do people use cursors in JDBC? Being able to FETCH seems like a nice > > way to handle question #2 above in a batch program, since only a subset of > > rows needs to be retrieved from the db at a time. Cursors probably don't > > work for question #1 above since keeping a transaction alive across page > > views is generally frowned upon and even hard to accomplish since it means > > locking up a connection to the db for each paging user. The question for me is how do you portably use cursors so that you can work with Oracle and PG seamlessly? I presume there might be some (hopefully) slight variations, like there are with BLOBs, but it would be nice if using cursors was standardized enough to make it using standard JDBC. It seems that the issues are with defining a cursor, executing it, fetching against it, then release it when done. Is there a standard way to do this? Any examples? Thanks, David