Received: from m4.c2.telstra-mm.net.au (m4.c2.telstra-mm.net.au [24.192.3.19]) by hub.org (8.9.2/8.9.1) with ESMTP id IAA93854 for ; Wed, 14 Apr 1999 08:59:20 -0400 (EDT) (envelope-from jbarnett@pobox.com) Received: from m5.c2.telstra-mm.net.au (m5.c2.telstra-mm.net.au [24.192.3.20]) by m4.c2.telstra-mm.net.au (8.8.6 (PHNE_14041)/8.8.6) with ESMTP id WAA02742 for ; Wed, 14 Apr 1999 22:59:17 +1000 (EST) X-BPC-Relay-Envelope-From: jbarnett@pobox.com X-BPC-Relay-Envelope-To: X-BPC-Relay-Sender-Host: m5.c2.telstra-mm.net.au [24.192.3.20] X-BPC-Relay-Info: Message delivered directly. Received: from persephone.hsys.com.au (CPE-24-192-48-71.nsw.bigpond.net.au [24.192.48.71]) by m5.c2.telstra-mm.net.au (8.8.6 (PHNE_14041)/8.8.6) with SMTP id WAA12492 for ; Wed, 14 Apr 1999 22:59:16 +1000 (EST) Received: by localhost with Microsoft MAPI; Wed, 14 Apr 1999 22:57:14 +1000 Message-ID: <01BE86CA.23683420.jbarnett@pobox.com> From: Jon Barnett Reply-To: "jbarnett@pobox.com" To: "'pgsql-interfaces@hub.org'" Subject: JDBC next() method Date: Wed, 14 Apr 1999 22:57:13 +1000 X-Mailer: Microsoft Internet E-mail/MAPI - 8.0.0.4211 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit I'm not quite sure about the correct operation of the JDBC next() method. Suppose I have the following code: queryResult = dbStatement.executeQuery("select max(history_id) from history"); if (queryResult.next()) nextID = queryResult.getLong(1) + 1; else nextID = 0; With the postgresql JDBC driver, the minimum value for nextID is 1, even if the history table is empty. I had expected that an empty result set would be returned if the history table is empty (0 rows returned for the select), and queryResult.next() would be false. Is this an incorrect interpretation on my part? Thanks, JonB.