From: Kris Jurka <books@ejurka.com>
To: Ruediger Herrmann <ruediger.herrmann@gmx.de>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: isLast() and empty ResultSet
Date: Thu, 21 Apr 2005 17:05:54 -0500 (EST)
Message-ID: <Pine.BSO.4.56.0504211700090.24801@leary.csoft.net> (raw)
In-Reply-To: <6626.1114117809@www66.gmx.net>
References: <6626.1114117809@www66.gmx.net>
On Thu, 21 Apr 2005, Ruediger Herrmann wrote:
> I implemented an Iterator interface iterating over a ResultSet. Therefore
> I rely on isLast() to implement the Iterator#hasNext() method. This works
> fine unless the whole ResultSet is empty.
> For empty RresultSets, isLast always returns true.
It always returns false because isLast implies that you are on the last
row of the ResultSet. If the ResultSet is empty you aren't on a row,
so you can't be on the last row.
Kris Jurka
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: books@ejurka.com, ruediger.herrmann@gmx.de
Subject: Re: isLast() and empty ResultSet
In-Reply-To: <Pine.BSO.4.56.0504211700090.24801@leary.csoft.net>
References: <6626.1114117809@www66.gmx.net> <Pine.BSO.4.56.0504211700090.24801@leary.csoft.net>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox