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

bug in the jdbc driver for postgress 7.0 (

From: Travis Bauer <trbauer(at)indiana(dot)edu>
To: pgsql-bugs(at)postgresql(dot)org
Subject: bug in the jdbc driver for postgress 7.0 (
Date: 2000-05-25 02:50:20
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-bugs
I think I've found a bug in how the jdbc driver (JDBC2) numbers the rows
in a result set.  According to Sun's documentation for the ResultSet
interface, the rows in a result set should be numbered starting with
1.  However, the's first() routine set's current_row to
0. The odd thing is that beforeFirst() also sets current_row to 0, it
just does not load this_row.  The bug manifests itself as such:

given ResultSet rs containing two rows:

System.out.println("Last id is: "+rs.getRow());
System.out.println("First id is: "+rs.getRow());

produces the output:

Last id is: 1
First id is: 0

I think the easiest fix would be to change getRow() so that it returns
current_row+1, and change beforeFirst so that it sets current_row to
-1.  I'm not sure what other changes need to be made, but since the JDBC
driver does not allow one to refer directly to row numbers, I can't think
of any other changes offhand.

Or am I all wet and this is not a bug?  Please respond to me directly, as
I'm not a member of this list.

Travis Bauer | CS Grad Student | IU |


pgsql-bugs by date

Next:From: Bruce MomjianDate: 2000-05-25 03:34:04
Subject: Re: bug in the jdbc driver for postgress 7.0 (
Previous:From: The Hermit HackerDate: 2000-05-24 19:07:04
Subject: Re: Just checking on a few bugs...

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