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

RE: JDBC getRow returns 0 after first instead of 1

From: Peter Mount <petermount(at)it(dot)maidstone(dot)gov(dot)uk>
To: "'Phil Davis'" <pmd(at)azad(dot)demon(dot)co(dot)uk>, pgsql-interfaces(at)postgresql(dot)org
Subject: RE: JDBC getRow returns 0 after first instead of 1
Date: 2000-07-31 12:20:58
Message-ID: 1B3D5E532D18D311861A00600865478CF1B194@exchange1.nt.maidstone.gov.uk (view raw or flat)
Thread:
Lists: 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(at)azad(dot)demon(dot)co(dot)uk]
Sent: Monday, July 31, 2000 1:18 PM
To: pgsql-interfaces(at)postgresql(dot)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(at)azad(dot)demon(dot)co(dot)uk

pgsql-interfaces by date

Next:From: Peter MountDate: 2000-07-31 12:22:06
Subject: RE: couldn't load DB driver : null
Previous:From: Phil DavisDate: 2000-07-31 12:18:05
Subject: JDBC getRow returns 0 after first instead of 1

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