isLast() and empty ResultSet

From: "Ruediger Herrmann" <ruediger(dot)herrmann(at)gmx(dot)de>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: isLast() and empty ResultSet
Date: 2005-04-21 21:10:09
Message-ID: 6626.1114117809@www66.gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Hello,

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.
Stepping through the code I found the reason therefore. Line 544 of
AbstractJdbc2ResultSet says
if (rows_size == 0)
return false; // No rows.
At least to me this is suspicious as I would return the opposite. Might that
be a bug or is there any other reason to behave like this?

I am using JDBC Driver 8.0 Build 311 and Server Version 8.0.2.

Regards
Rüdiger

--
+++ NEU: GMX DSL_Flatrate! Schon ab 14,99 EUR/Monat! +++

GMX Garantie: Surfen ohne Tempo-Limit! http://www.gmx.net/de/go/dsl

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Vernon 2005-04-21 21:13:49 What Hibernate Object ID generator is recommanded for PG?
Previous Message Kris Jurka 2005-04-21 21:00:59 Re: Interval support for Postgres