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 81EE752BBF for ; Wed, 27 Jul 2005 11:46:17 -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 70618-07 for ; Wed, 27 Jul 2005 14:46:11 +0000 (GMT) Received: from mail.digitalfairway.ca (ns.digitalfairway.ca [207.164.133.170]) by svr1.postgresql.org (Postfix) with ESMTP id 5FB9352A83 for ; Wed, 27 Jul 2005 11:46:09 -0300 (ADT) Received: from toronto.toronto.digitalfairway.ca (unknown [192.168.100.10]) by mail.digitalfairway.ca (Postfix) with ESMTP id 8FA9A951CF for ; Wed, 27 Jul 2005 10:46:08 -0400 (EDT) Received: from localhost (toronto.toronto.digitalfairway.ca [127.0.0.1]) by toronto.toronto.digitalfairway.ca (Postfix) with ESMTP id 865FEA00CE for ; Wed, 27 Jul 2005 10:46:07 -0400 (EDT) Received: from toronto.toronto.digitalfairway.ca ([127.0.0.1]) by localhost (toronto.toronto.digitalfairway.ca [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 22050-08 for ; Wed, 27 Jul 2005 10:46:07 -0400 (EDT) Received: from [192.168.100.50] (unknown [192.168.100.50]) (using SSLv3 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) by toronto.toronto.digitalfairway.ca (Postfix) with ESMTP id 6DA73A00CD for ; Wed, 27 Jul 2005 10:46:07 -0400 (EDT) From: Jan de Visser To: pgsql-jdbc@postgresql.org Subject: Re: unusual ResultSet.next() behaviour Date: Wed, 27 Jul 2005 10:46:06 -0400 User-Agent: KMail/1.8.1 References: <1122440425.20140@workhorse.newkinetics.com> In-Reply-To: <1122440425.20140@workhorse.newkinetics.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200507271046.06174.jdevisser@digitalfairway.com> X-Virus-Scanned: amavisd-new at digitalfairway.ca X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.042 tagged_above=0 required=5 tests=AWL, FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200507/366 X-Sequence-Number: 13514 =46irst off, you need a different e-mail client. The one you're using makes= a=20 royal mess of MIME messages. Please stop using it (at least don't use it to= =20 send to this list :) On Wednesday 27 July 2005 01:00, Les Carter wrote: > Consider the following code snippet where rs is a ResultSet object obtain= ed > from a previous query: > > =A0=A0=A0 for(int count=3D0; count!=3DsomeValue; count++) > =A0=A0=A0 { > =A0=A0=A0=A0=A0=A0=A0 if(!rs.next()) throw SomeException(); > =A0=A0=A0 } > =A0=A0=A0 rs.next(); > > Pretty simple, just cycle through someValue number of records and then get > the next record after that.=A0 For some reason, say if the query has 20 r= ows > that will be returned, and I set someValue to be 5 for arguments sake, it > will go through the for loop with no problems, but when it comes out of t= he > for loop and tries to the next rs.next() operation it always returns > false.=A0 I can increase someValue to 10 and it will still loop without a > problem, but it will always return false for that rs.next() operation > following the for loop. > > I can't see any rational reason for this.=A0 I'm using PostgreSQL 8.0 and= the > JDBC 3 drivers on Win XP with JDK 1.42_06.=A0 The ResultS! et is a proxy > object gained from a JBoss4.0 supplied connection pool. > > Can anyone offer any explanation, or repeat the simple steps to confirm I= 'm > not loosing my sanity? Works for me. I don't see what you're experiencing; my next() after the loo= p=20 returns true. > > Cheers, > > L JdV!! =2D-=20 =2D------------------------------------------------------------- Jan de Visser =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 jdevisser@digitalfair= way.com =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 Baruk Khazad! Khazad ai-menu! =2D-------------------------------------------------------------