pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: David Gagnon <dgagnon@siunik.com>
To: pgsql-jdbc@postgresql.org
Subject: ResultSet.relative(0) throws "Cannot move to index of 0" but should not as explain in the Javadoc.
Date: Mon, 18 Apr 2005 09:00:03 -0400
Message-ID: <4263AF53.7030903@siunik.com> (raw)
In-Reply-To: <425F0BE9.60708@fastcrypt.com>
References: <20050415001606.11426.qmail@web40502.mail.yahoo.com>
	<425F0BE9.60708@fastcrypt.com>

Hi all,

  I just ran into what i think is a compliance problem.  I can't call ResultSet.relative(0) without getting in exception.  As stated in the javadoc it's should just do NOTHING.


Am I wrong?

Best regards
/David

rs.relative(skipResults);

if (index==0)
>    	    throw new SQLException("Cannot move to index of 0");


 /**
     * Moves the cursor a relative number of rows, either positive or 
negative.
     * Attempting to move beyond the first/last row in the
     * result set positions the cursor before/after the
     * the first/last row. Calling <code>relative(0)</code> is valid, 
but does
     * not change the cursor position.
     *
     * <p>Note: Calling the method <code>relative(1)</code>
     * is identical to calling the method <code>next()</code> and
     * calling the method <code>relative(-1)</code> is identical
     * to calling the method <code>previous()</code>.
     *
     * @param rows an <code>int</code> specifying the number of rows to
     *        move from the current row; a positive number moves the cursor
     *        forward; a negative number moves the cursor backward
     * @return <code>true</code> if the cursor is on a row;
     *         <code>false</code> otherwise
     * @exception SQLException if a database access error occurs,
     *            there is no current row, or the result set type is
     *            <code>TYPE_FORWARD_ONLY</code>
     * @since 1.2
     */



view thread (3+ messages)  latest in thread

Message-ID: <4263AF53.7030903@siunik.com>
Permalink:  ../4263AF53.7030903@siunik.com/
Also on:    postgresql.org/message-id/4263AF53.7030903@siunik.com

 · 

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: dgagnon@siunik.com
  Subject: Re: ResultSet.relative(0) throws "Cannot move to index of 0" but should not as explain in the Javadoc.
  In-Reply-To: <4263AF53.7030903@siunik.com>
  References: <20050415001606.11426.qmail@web40502.mail.yahoo.com> <425F0BE9.60708@fastcrypt.com> <4263AF53.7030903@siunik.com>

* 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