ResultSet.relative(0) throws "Cannot move to index of 0" but should not as explain in the Javadoc.

From: David Gagnon <dgagnon(at)siunik(dot)com>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: ResultSet.relative(0) throws "Cannot move to index of 0" but should not as explain in the Javadoc.
Date: 2005-04-18 13:00:03
Message-ID: 4263AF53.7030903@siunik.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

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
*/

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Kris Jurka 2005-04-18 18:32:22 Re: ResultSet.relative(0) throws "Cannot move to index of 0"
Previous Message Dave Cramer 2005-04-18 12:21:44 Re: Have Question