unusual ResultSet.next() behaviour - Mailing list pgsql-jdbc

From Les Carter
Subject unusual ResultSet.next() behaviour
Date
Msg-id 1122440425.20140@workhorse.newkinetics.com
Whole thread Raw
Responses Re: unusual ResultSet.next() behaviour  (Jan de Visser <jdevisser@digitalfairway.com>)
Re: unusual ResultSet.next() behaviour  (Oliver Jowett <oliver@opencloud.com>)
Re: unusual ResultSet.next() behaviour  ("emergency.shower@gmail.com" <emergency.shower@gmail.com>)
List pgsql-jdbc
This is a multi-part message in MIME format. --bound1122440425 Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding:quoted-printable Consider the following code snippet where rs is a ResultSet object obtained
froma previous query:<br /><br />    for(int count=0; count!=someValue; count++)<br />    {<br />        if(!rs.next())
throwSomeException();<br />    }<br />    rs.next();<br /><br />Pretty simple, just cycle through someValue number of
recordsand then get the next record after that.  For some reason, say if the query has 20 rows that will be returned,
andI set someValue to be 5 for arguments sake, it will go through the for loop with no problems, but when it comes out
ofthe for loop and tries to the next rs.next() operation it always returns false.  I can increase someValue to 10 and
itwill still loop without a problem, but it will always return false for that rs.next() operation following the for
loop.<br/><br />I can't see any rational reason for this.  I'm using PostgreSQL 8.0 and the JDBC 3 drivers on Win XP
withJDK 1.42_06.  The ResultS! et is a proxy object gained from a JBoss4.0 supplied connection pool.<br /><br />Can
anyoneoffer any explanation, or repeat the simple steps to confirm I'm not loosing my sanity?<br /><br />Cheers,<br
/><br/>L<br /> --bound1122440425--  

pgsql-jdbc by date:

Previous
From: Roland Walter
Date:
Subject: Re: INSERT and get ID
Next
From: Sebastiaan van Erk
Date:
Subject: Re: INSERT and get ID