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

Re: isLast() and empty ResultSet

From: Kris Jurka <books(at)ejurka(dot)com>
To: Ruediger Herrmann <ruediger(dot)herrmann(at)gmx(dot)de>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: isLast() and empty ResultSet
Date: 2005-04-21 22:05:54
Message-ID: Pine.BSO.4.56.0504211700090.24801@leary.csoft.net (view raw or flat)
Thread:
Lists: pgsql-jdbc

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

In response to

pgsql-jdbc by date

Next:From: Oliver JowettDate: 2005-04-21 22:14:34
Subject: Re: What Hibernate Object ID generator is recommanded for
Previous:From: Dennis SacksDate: 2005-04-21 21:59:11
Subject: Re: switching from 7.4.1 to 8.0-311 jdbc driver

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