Re: ResultSet.getObject return type for smallint - Mailing list pgsql-jdbc

From Oliver Jowett
Subject Re: ResultSet.getObject return type for smallint
Date
Msg-id 42A64E75.2060402@opencloud.com
Whole thread Raw
In response to ResultSet.getObject return type for smallint  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
List pgsql-jdbc
Kevin Grittner wrote:
>
> According to Appendix B of the JDBC spec, ResultSet.getObject should use
> the mapping shown in table B-3 to determine the object class returned.
>  Table B-3 shows SMALLINT mapping to Integer.  In
> postgresql-jdbc-8.0-311 a Short is returned instead, which is causing
> problems for our software.  It looks like a one-line change will fix
> this -- in the
> org.postgresql.jdbc2.AbstractJdbc2ResultSet.internalGetObject method.

Thanks for the report. I've applied a fix for this, plus support for
various other types in the mapping table that getObject() didn't handle
at all (BOOLEAN, TINYINT, DECIMAL, LONGVARCHAR, LONGVARBINARY, CLOB,
BLOB) to CVS HEAD and the stable 8.0 branch.

-O

pgsql-jdbc by date:

Previous
From: "Kevin Grittner"
Date:
Subject: ResultSet.getObject return type for smallint
Next
From: Tom Lane
Date:
Subject: Re: DatabaseMetaData and Transactions