Skip site navigation (1) Skip section navigation (2)

Re: absolute() error with jdbc7.1-1.2

From: Liam Stewart <liams(at)redhat(dot)com>
To: pgsql-jdbc(at)postgresql(dot)org, pgsql-patches(at)postgresql(dot)org
Subject: Re: absolute() error with jdbc7.1-1.2
Date: 2001-11-13 21:26:59
Message-ID: 20011113162659.D4298@redhat.com (view raw or flat)
Thread:
Lists: pgsql-jdbcpgsql-patches
Attached is a patch against the CVS repository that fixes the problem.
There's also a little fix for the getRow() method. While fixing
absolute(), I noticed that getRow() wasn't quite following the spec: it
wasn't returning 0 when the ResultSet wasn't positioned on a row.  I've
started a ResultSet test case and included it as well.

Liam

On Mon, Nov 12, 2001 at 10:53:45AM -0800, Robert Down wrote:
> with the lasttest driver, I can't use absolute() according to the spec.
> 
> index = -1;
> rs.absolute(index);      
> 
> What it currently does:
> java.lang.ArrayIndexOutOfBoundsException: -2 < 0
> 
> 
> What it should do according to the spec:
> ========================================
> public boolean absolute(int row)
>                  throws SQLExceptionMoves the cursor to the given row number 
> in this ResultSet object. 
> 
> If the row number is positive, the cursor moves to the given row number with 
> respect to the beginning of the result set. The first row is row 1, the 
> second is row 2, and so on. 
> 
> If the given row number is negative, the cursor moves to an absolute row 
> position with respect to the end of the result set. For example, calling the 
> method absolute(-1) positions the cursor on the last row; calling the method 
> absolute(-2) moves the cursor to the next-to-last row, and so on. 
> 
> An attempt to position the cursor beyond the first/last row in the result set 
> leaves the cursor before the first row or after the last row. 
> ===========================================
> 
> Please note the important fact that you can use (-1) as a position.  This is 
> very important.
> 
> Thanks!
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> message can get through to the mailing list cleanly

-- 
Liam Stewart :: Red Hat Canada, Ltd. :: liams(at)redhat(dot)com

In response to

Responses

pgsql-patches by date

Next:From: Tom LaneDate: 2001-11-13 21:40:34
Subject: Re: Patch to add Heimdal kerberos support
Previous:From: Bill StudenmundDate: 2001-11-13 16:53:56
Subject: Re: Patch to add Heimdal kerberos support

pgsql-jdbc by date

Next:From: Liam StewartDate: 2001-11-13 21:28:57
Subject: Re: Funny timezone shift causes failure in test suite
Previous:From: Marc G. FournierDate: 2001-11-13 20:08:02
Subject: Re: Remember to register PostgreSQL for JDJ 2002 awards (fwd)

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group