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

Поиск
Список
Период
Сортировка
От David Gagnon
Тема ResultSet.relative(0) throws "Cannot move to index of 0" but should not as explain in the Javadoc.
Дата
Msg-id 4263AF53.7030903@siunik.com
обсуждение исходный текст
Ответ на Re: Error with a hibernate query  (Dave Cramer <pg@fastcrypt.com>)
Ответы Re: ResultSet.relative(0) throws "Cannot move to index of 0"  (Kris Jurka <books@ejurka.com>)
Список 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
     */

В списке pgsql-jdbc по дате отправления:

Предыдущее
От: Dave Cramer
Дата:
Сообщение: Re: Have Question
Следующее
От: Kris Jurka
Дата:
Сообщение: Re: ResultSet.relative(0) throws "Cannot move to index of 0"