pg.ddx.io pgsql-jdbc@postgresql.org mailing list archive
help / color / mirror / Atom feedResultSet.getObject return type for smallint
2+ messages / 2 participants
[nested] [flat]
* ResultSet.getObject return type for smallint
@ 2005-06-07 22:57 Kevin Grittner <Kevin.Grittner@wicourts.gov>
2005-06-08 01:48 ` Re: ResultSet.getObject return type for smallint Oliver Jowett <oliver@opencloud.com>
0 siblings, 1 reply; 2+ messages in thread
From: Kevin Grittner @ 2005-06-07 22:57 UTC (permalink / raw)
To: pgsql-jdbc
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.
Index: AbstractJdbc2ResultSet.java
===================================================================
RCS file:
/usr/local/cvsroot/pgjdbc/pgjdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java,v
retrieving revision 1.74
inline patch 1: AbstractJdbc2ResultSet.java7 Jun 2005 22:53:02 -0000 (+0/-0 lines) download inline-1.patch
diff -u -r1.74 AbstractJdbc2ResultSet.java
--- AbstractJdbc2ResultSet.java8 May 2005 23:50:56 -00001.74
+++ AbstractJdbc2ResultSet.java7 Jun 2005 22:53:02 -0000
@@ -115,7 +115,7 @@
case Types.BIT:
return getBoolean(columnIndex) ? Boolean.TRUE :
Boolean.FALSE;
case Types.SMALLINT:
- return new Short(getShort(columnIndex));
+ return new Integer(getShort(columnIndex));
case Types.INTEGER:
return new Integer(getInt(columnIndex));
case Types.BIGINT:
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: ResultSet.getObject return type for smallint
2005-06-07 22:57 ResultSet.getObject return type for smallint Kevin Grittner <Kevin.Grittner@wicourts.gov>
@ 2005-06-08 01:48 ` Oliver Jowett <oliver@opencloud.com>
0 siblings, 0 replies; 2+ messages in thread
From: Oliver Jowett @ 2005-06-08 01:48 UTC (permalink / raw)
To: Kevin Grittner <Kevin.Grittner@wicourts.gov>; +Cc: 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
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2005-06-08 01:48 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-06-07 22:57 ResultSet.getObject return type for smallint Kevin Grittner <Kevin.Grittner@wicourts.gov>
2005-06-08 01:48 ` Oliver Jowett <oliver@opencloud.com>
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