pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
ResultSet.relative(0) throws "Cannot move to index of 0" but should not as explain in the Javadoc.
3+ messages / 2 participants
[nested] [flat]

* ResultSet.relative(0) throws "Cannot move to index of 0" but should not as explain in the Javadoc.
@ 2005-04-18 13:00 David Gagnon <dgagnon@siunik.com>
  2005-04-18 18:32 ` Re: ResultSet.relative(0) throws "Cannot move to index of 0" Kris Jurka <books@ejurka.com>
  0 siblings, 1 reply; 3+ messages in thread

From: David Gagnon @ 2005-04-18 13:00 UTC (permalink / raw)
  To: 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
     */



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: ResultSet.relative(0) throws "Cannot move to index of 0"
  2005-04-18 13:00 ResultSet.relative(0) throws "Cannot move to index of 0" but should not as explain in the Javadoc. David Gagnon <dgagnon@siunik.com>
@ 2005-04-18 18:32 ` Kris Jurka <books@ejurka.com>
  2005-04-18 18:58   ` Re: ResultSet.relative(0) throws "Cannot move to index of 0" David Gagnon <dgagnon@siunik.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Kris Jurka @ 2005-04-18 18:32 UTC (permalink / raw)
  To: David Gagnon <dgagnon@siunik.com>; +Cc: pgsql-jdbc



On Mon, 18 Apr 2005, David Gagnon wrote:

>   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.

This is a bug and is only present in the 7.4 tree.  I've fixed it there.  
I'll gather up a couple more 7.4 changes and put out a new 7.4 release in 
a couple of days.  For now I can offer you 
http://www.ejurka.com/pgsql/jars/dgagnon/pg74-dg-jdbc3.jar as I don't 
happen to have other compilers available.

Kris Jurka



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: ResultSet.relative(0) throws "Cannot move to index of 0"
  2005-04-18 13:00 ResultSet.relative(0) throws "Cannot move to index of 0" but should not as explain in the Javadoc. David Gagnon <dgagnon@siunik.com>
  2005-04-18 18:32 ` Re: ResultSet.relative(0) throws "Cannot move to index of 0" Kris Jurka <books@ejurka.com>
@ 2005-04-18 18:58   ` David Gagnon <dgagnon@siunik.com>
  0 siblings, 0 replies; 3+ messages in thread

From: David Gagnon @ 2005-04-18 18:58 UTC (permalink / raw)
  To: Kris Jurka <books@ejurka.com>; +Cc: pgsql-jdbc

Thanks!

      I also try a rs.relative(-1) when I was positionned before the 
first row.  I was not eable to get my result after that.  I'm note sure 
about this one though.. And it's not easy to test it agains ... I you 
don't know about this one .. it's either a mistake I made myself or 
another bug.  If you want I cant test it when I have a chance...

Let me know!
Thanks again
/David


Kris Jurka wrote:

>On Mon, 18 Apr 2005, David Gagnon wrote:
>
>  
>
>>  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.
>>    
>>
>
>This is a bug and is only present in the 7.4 tree.  I've fixed it there.  
>I'll gather up a couple more 7.4 changes and put out a new 7.4 release in 
>a couple of days.  For now I can offer you 
>http://www.ejurka.com/pgsql/jars/dgagnon/pg74-dg-jdbc3.jar as I don't 
>happen to have other compilers available.
>
>Kris Jurka
>
>  
>




^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2005-04-18 18:58 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-04-18 13:00 ResultSet.relative(0) throws "Cannot move to index of 0" but should not as explain in the Javadoc. David Gagnon <dgagnon@siunik.com>
2005-04-18 18:32 ` Re: ResultSet.relative(0) throws "Cannot move to index of 0" Kris Jurka <books@ejurka.com>
2005-04-18 18:58   ` Re: ResultSet.relative(0) throws "Cannot move to index of 0" David Gagnon <dgagnon@siunik.com>

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