Home > Archive > PostgreSQL JDBC > April 2005 > Re: isLast() and empty ResultSet









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: isLast() and empty ResultSet
Kris Jurka

2005-04-21, 8:24 pm



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

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql
.org so that your
message can get through to the mailing list cleanly

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com