pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ruediger Herrmann <ruediger.herrmann@gmx.de>
To: pgsql-jdbc@postgresql.org
Subject: isLast() and empty ResultSet
Date: Thu, 21 Apr 2005 23:10:09 +0200 (MEST)
Message-ID: <6626.1114117809@www66.gmx.net> (raw)

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



view thread (4+ messages)  latest in thread

Message-ID: <6626.1114117809@www66.gmx.net>
Permalink:  ../6626.1114117809@www66.gmx.net/
Also on:    postgresql.org/message-id/6626.1114117809@www66.gmx.net

 · 

reply

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: ruediger.herrmann@gmx.de
  Subject: Re: isLast() and empty ResultSet
  In-Reply-To: <6626.1114117809@www66.gmx.net>
  References: <6626.1114117809@www66.gmx.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