RE: JDBC 7.0 - ResultSet.getObject() bug - Mailing list pgsql-interfaces

From Peter Mount
Subject RE: JDBC 7.0 - ResultSet.getObject() bug
Date
Msg-id 1B3D5E532D18D311861A00600865478CF1AE31@exchange1.nt.maidstone.gov.uk
Whole thread Raw
In response to JDBC 7.0 - ResultSet.getObject() bug  (Gunnar R|nning <gunnar@candleweb.no>)
List pgsql-interfaces
Hmmm, it should test using isNull() before trying to parse the object
type. I'll check.

Peter

-- 
Peter Mount
Enterprise Support
Maidstone Borough Council
Any views stated are my own, and not those of Maidstone Borough Council.



-----Original Message-----
From: Gunnar R|nning [mailto:gunnar@candleweb.no]
Sent: Tuesday, May 23, 2000 2:48 PM
To: pgsql-interfaces@postgresql.org
Subject: [INTERFACES] JDBC 7.0 - ResultSet.getObject() bug


Hello, 

I just discovered what I think must be regarded as bug in the JDBC
driver
shipped with the 7.0 release. 

The JDBC spec states that ResultSet.getObject() should return "null" if
the
there is an SQL NULL value in the column. The JDBC driver for postgres
does
however in this case return an object, eg. in the case of an int value
it
returns an Integer object with the value of "0". 

From looking at source code it is apparent that the problem is that the
getObject() method reuses the public getInt() methods with friends. 

Regards, Gunnar


pgsql-interfaces by date:

Previous
From: Gunnar R|nning
Date:
Subject: JDBC 7.0 - PreparedStatement.setObject() bug.
Next
From: Gunnar R|nning
Date:
Subject: JDBC escape processing