bug in the jdbc driver for postgress 7.0 (ResultSet.java)

Поиск
Список
Период
Сортировка
От Travis Bauer
Тема bug in the jdbc driver for postgress 7.0 (ResultSet.java)
Дата
Msg-id Pine.GSO.4.21.0005242140250.1142-100000@mantaray.cs.indiana.edu
обсуждение исходный текст
Ответы Re: bug in the jdbc driver for postgress 7.0 (ResultSet.java)  (Bruce Momjian <pgman@candle.pha.pa.us>)
Список 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 ResultSet.java'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:

rs.last();
System.out.println("Last id is: "+rs.getRow());
rs.first();
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 |www.cs.indiana.edu/~trbauer
----------------------------------------------------------------

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

Предыдущее
От: The Hermit Hacker
Дата:
Сообщение: Re: Just checking on a few bugs...
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: bug in the jdbc driver for postgress 7.0 (ResultSet.java)