isLast() and empty ResultSet - Mailing list pgsql-jdbc

From Ruediger Herrmann
Subject isLast() and empty ResultSet
Date
Msg-id 6626.1114117809@www66.gmx.net
Whole thread Raw
Responses Re: isLast() and empty ResultSet
Re: isLast() and empty ResultSet
List 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

pgsql-jdbc by date:

Previous
From: Kris Jurka
Date:
Subject: Re: Interval support for Postgres
Next
From: Vernon
Date:
Subject: What Hibernate Object ID generator is recommanded for PG?