Skip site navigation (1) Skip section navigation (2)

RE: [INTERFACES] JDBC next() method

From: Peter Mount <petermount(at)it(dot)maidstone(dot)gov(dot)uk>
To: jbarnett(at)pobox(dot)com, "'pgsql-interfaces(at)hub(dot)org'" <pgsql-interfaces(at)hub(dot)org>
Subject: RE: [INTERFACES] JDBC next() method
Date: 1999-04-14 13:18:23
Message-ID: (view raw or whole thread)
Lists: pgsql-interfaces
This looks ok.

queryResult is null if there was an error in the query, so you should
check for that.

However, normal use would have the result parsed within a
while( {} loop, so your interpretation is correct.


Peter T Mount, IT Section
Anything I write here are my own views, and cannot be taken as the
official words of Maidstone Borough Council

-----Original Message-----
From: Jon Barnett [mailto:jbarnett(at)pobox(dot)com]
Sent: Wednesday, April 14, 1999 1:57 PM
To: 'pgsql-interfaces(at)hub(dot)org'
Subject: [INTERFACES] JDBC next() method

I'm not quite sure about the correct operation of the JDBC next()

Suppose I have the following code:

queryResult = dbStatement.executeQuery("select max(history_id) from
if (
	nextID = queryResult.getLong(1) + 1;
	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
returned if the history table is empty (0 rows returned for the select),
and would be false.  Is this an incorrect interpretation
on my 



pgsql-interfaces by date

Next:From: Jon BarnettDate: 1999-04-14 14:37:03
Subject: RE: [INTERFACES] JDBC next() method
Previous:From: Jon BarnettDate: 1999-04-14 12:57:13
Subject: JDBC next() method

Privacy Policy | About PostgreSQL
Copyright © 1996-2015 The PostgreSQL Global Development Group