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 94F8852FDE for ; Mon, 25 Jul 2005 20:15:04 -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 20083-07 for ; Mon, 25 Jul 2005 23:15:02 +0000 (GMT) Received: from yass.opencloud.co.nz (yass.opencloud.co.nz [203.79.85.162]) by svr1.postgresql.org (Postfix) with ESMTP id AB30352FAC for ; Mon, 25 Jul 2005 20:15:01 -0300 (ADT) Received: from 203-79-104-60.cable.paradise.net.nz ([203.79.104.60] helo=[192.168.0.20]) by yass.opencloud.co.nz with asmtp (TLS-1.0:DHE_RSA_AES_128_CBC_SHA:16) (Exim 4.34) id 1DxCA4-0006yz-0s; Tue, 26 Jul 2005 11:15:04 +1200 Message-ID: <42E57277.70101@opencloud.com> Date: Tue, 26 Jul 2005 11:15:03 +1200 From: Oliver Jowett User-Agent: Mozilla Thunderbird 1.0.2 (X11/20050324) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Les Carter Cc: pgsql-jdbc@postgresql.org Subject: Re: getMoreResults() issue References: <1122277206.13050@workhorse.newkinetics.com> In-Reply-To: <1122277206.13050@workhorse.newkinetics.com> X-Enigmail-Version: 0.90.2.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.007 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200507/300 X-Sequence-Number: 13448 Les Carter wrote: > This is a multi-part message in MIME format. --bound1122277206 > Content-Type: text/html; charset=o-8859-1 Content-Transfer-Encoding: > quoted-printable Your mail client seems to be a bit confused there; I don't see any MIME headers in the mail header itself. > Has anyone else managed to get > Statement.getMoreResults() working with the JDBC3 drivers and Postgres > 8? It's always coming back as false for me even though I know there's > more data. getMoreResults() returns false if either there are no more results, or the next result is an update count. You must also check getUpdateCount() to work out if you've run out of results or not. See the javadoc for details. As far as I know, getMoreResults() in the current driver works just fine. > Has anyone got a working example? I posted an example to the list recently -- check the archives (archives.postgresql.org). > Does this method only work for PreparedStatements or does a regular > Statement also bring back large numbers of rows from the DB in pages? getMoreResults() has nothing to do with "paging" large result sets, it's to do with retriving multiple resultsets from a query that has many statements -- e.g. "SELECT * FROM foo; SELECT * FROM bar; INSERT INTO baz(1,2,3)" will return two resultsets and an update count. If you want to retrieve a large resultset incrementally: - use a TYPE_FORWARD_ONLY resultset - ensure autocommit is off - set a non-zero fetchsize and the driver will do the rest transparently, fetching data in blocks behind the scenes. -O