pg.ddx.io pgsql-interfaces@postgresql.org mailing list archive
help / color / mirror / Atom feedJDBC getRow returns 0 after first instead of 1
5+ messages / 4 participants
[nested] [flat]
* JDBC getRow returns 0 after first instead of 1
@ 2000-07-31 12:18 Phil Davis <pmd@azad.demon.co.uk>
2000-07-31 15:26 ` Re: JDBC getRow returns 0 after first instead of 1 Joseph Shraibman <jks@selectacast.net>
0 siblings, 1 reply; 5+ messages in thread
From: Phil Davis @ 2000-07-31 12:18 UTC (permalink / raw)
To: pgsql-interfaces
I think the JDBC driver has several bugs around ResultSet row
numbering. According to the JDBC API docs[1] the getRow() method on
ResultSet should return 1 for the first row. Currently it returns zero.
i.e.
if (rs.first())
int n = rs.getRow(); // n is now 0 instead of 1
The same problem exists with the absolute and related methods which
need to be passed 0 to go to the first row but the API docs say it should
be 1.
If I'm wrong could someone please explain what I got wrong.
PS,
Where is the CVS archive for the sources and is there anon access? I could
not find it on the postgresql.org site.
[1] http://java.sun.com/j2se/1.3/docs/api/java/sql/ResultSet.html#getRow()
--
Phil Davis - pmd@azad.demon.co.uk
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: JDBC getRow returns 0 after first instead of 1
2000-07-31 12:18 JDBC getRow returns 0 after first instead of 1 Phil Davis <pmd@azad.demon.co.uk>
@ 2000-07-31 15:26 ` Joseph Shraibman <jks@selectacast.net>
2000-07-31 17:28 ` Re: JDBC getRow returns 0 after first instead of 1 Phil Davis <pmd@azad.demon.co.uk>
0 siblings, 1 reply; 5+ messages in thread
From: Joseph Shraibman @ 2000-07-31 15:26 UTC (permalink / raw)
To: Phil Davis <pmd@azad.demon.co.uk>; +Cc: pgsql-interfaces
What version of the driver are you using? I fixed some off by one
errors and my fixes made it into the cvs after 7.0
Phil Davis wrote:
>
> I think the JDBC driver has several bugs around ResultSet row
> numbering. According to the JDBC API docs[1] the getRow() method on
> ResultSet should return 1 for the first row. Currently it returns zero.
>
> i.e.
> if (rs.first())
> int n = rs.getRow(); // n is now 0 instead of 1
>
> The same problem exists with the absolute and related methods which
> need to be passed 0 to go to the first row but the API docs say it should
> be 1.
>
> If I'm wrong could someone please explain what I got wrong.
>
> PS,
> Where is the CVS archive for the sources and is there anon access? I could
> not find it on the postgresql.org site.
>
> [1] http://java.sun.com/j2se/1.3/docs/api/java/sql/ResultSet.html#getRow()
>
> --
> Phil Davis - pmd@azad.demon.co.uk
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: JDBC getRow returns 0 after first instead of 1
2000-07-31 12:18 JDBC getRow returns 0 after first instead of 1 Phil Davis <pmd@azad.demon.co.uk>
2000-07-31 15:26 ` Re: JDBC getRow returns 0 after first instead of 1 Joseph Shraibman <jks@selectacast.net>
@ 2000-07-31 17:28 ` Phil Davis <pmd@azad.demon.co.uk>
2000-07-31 17:56 ` Re: JDBC getRow returns 0 after first instead of 1 Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 5+ messages in thread
From: Phil Davis @ 2000-07-31 17:28 UTC (permalink / raw)
To: Joseph Shraibman <jks@selectacast.net>; +Cc: pgsql-interfaces
On Mon, Jul 31, 2000 at 11:26:50AM -0400, Joseph Shraibman wrote:
> What version of the driver are you using? I fixed some off by one
> errors and my fixes made it into the cvs after 7.0
I am using jdbc6.5-1.2.jar but I downloaded the development snapshot.support
from a mirror today (seemed to be dated 25 July ish) and it looks like
it still has the bug since getRow() returns current_row and first() sets
current_row to 0 but I have not upgraded to V7 backend yet so cannot test
yet.
Anyway I still have not found the CVS access info yet!
--
Phil Davis - pmd@azad.demon.co.uk
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: JDBC getRow returns 0 after first instead of 1
2000-07-31 12:18 JDBC getRow returns 0 after first instead of 1 Phil Davis <pmd@azad.demon.co.uk>
2000-07-31 15:26 ` Re: JDBC getRow returns 0 after first instead of 1 Joseph Shraibman <jks@selectacast.net>
2000-07-31 17:28 ` Re: JDBC getRow returns 0 after first instead of 1 Phil Davis <pmd@azad.demon.co.uk>
@ 2000-07-31 17:56 ` Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 0 replies; 5+ messages in thread
From: Tom Lane @ 2000-07-31 17:56 UTC (permalink / raw)
To: Phil Davis <pmd@azad.demon.co.uk>; +Cc: Joseph Shraibman <jks@selectacast.net>; pgsql-interfaces
Phil Davis <pmd@azad.demon.co.uk> writes:
> Anyway I still have not found the CVS access info yet!
It's in the on-line reference manual:
http://www.postgresql.org/docs/postgres/cvs.htm
At one time there was a link to this info from the "download" page,
but I don't see one there now ...
regards, tom lane
^ permalink raw reply [nested|flat] 5+ messages in thread
* RE: JDBC getRow returns 0 after first instead of 1
@ 2000-07-31 12:20 Peter Mount <petermount@it.maidstone.gov.uk>
0 siblings, 0 replies; 5+ messages in thread
From: Peter Mount @ 2000-07-31 12:20 UTC (permalink / raw)
To: 'Phil Davis' <pmd@azad.demon.co.uk>; pgsql-interfaces
I'll check. It should be returning 1 (as JDBC numbering always starts at 1).
The Anon cvs should be documented on postgresql.org (although when I last
checked, there was no link to it).
Peter
--
Peter Mount
Enterprise Support
Maidstone Borough Council
Any views stated are my own, and not those of Maidstone Borough Council
-----Original Message-----
From: Phil Davis [mailto:pmd@azad.demon.co.uk]
Sent: Monday, July 31, 2000 1:18 PM
To: pgsql-interfaces@postgresql.org
Subject: [INTERFACES] JDBC getRow returns 0 after first instead of 1
I think the JDBC driver has several bugs around ResultSet row
numbering. According to the JDBC API docs[1] the getRow() method on
ResultSet should return 1 for the first row. Currently it returns zero.
i.e.
if (rs.first())
int n = rs.getRow(); // n is now 0 instead of 1
The same problem exists with the absolute and related methods which
need to be passed 0 to go to the first row but the API docs say it should
be 1.
If I'm wrong could someone please explain what I got wrong.
PS,
Where is the CVS archive for the sources and is there anon access? I could
not find it on the postgresql.org site.
[1] http://java.sun.com/j2se/1.3/docs/api/java/sql/ResultSet.html#getRow()
--
Phil Davis - pmd@azad.demon.co.uk
^ permalink raw reply [nested|flat] 5+ messages in thread
end of thread, other threads:[~2000-07-31 17:56 UTC | newest]
Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2000-07-31 12:18 JDBC getRow returns 0 after first instead of 1 Phil Davis <pmd@azad.demon.co.uk>
2000-07-31 15:26 ` Joseph Shraibman <jks@selectacast.net>
2000-07-31 17:28 ` Phil Davis <pmd@azad.demon.co.uk>
2000-07-31 17:56 ` Tom Lane <tgl@sss.pgh.pa.us>
2000-07-31 12:20 RE: JDBC getRow returns 0 after first instead of 1 Peter Mount <petermount@it.maidstone.gov.uk>
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