From: Kris Jurka <books@ejurka.com>
To: David Clark <davidclark@tx.rr.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Bug in org.postgresql.jdbc2.AbstractJdbc2ResultSet?
Date: Mon, 30 Apr 2007 18:34:27 -0400 (EDT)
Message-ID: <Pine.BSO.4.64.0704301828260.28527@leary.csoft.net> (raw)
In-Reply-To: <200704301645.37898.davidclark@tx.rr.com>
References: <200704301645.37898.davidclark@tx.rr.com>
On Mon, 30 Apr 2007, David Clark wrote:
> There seems to be a bug in internalGetObject(int, Field) in
> org.postgresql.jdbc2.AbstractJdbc2ResultSet. I am using the
> postgresql-jdbc-8.0-319.src sources. I am placing the patch file inline
> below in case the mailing list does not accept attachments. The bug (?) is
> that for TINYINT and SMALLINT columns a java.lang.Short should be returned
> from internalGetObject, but an Integer is returned instead.
>
Actually this behavior is correct according to the JDBC spec. If you see
Appendix B [1] it says:
Note - The JDBC 1.0 specification defined the Java object mapping for the
SMALLINT and TINYINT JDBC types to be Integer. The Java language did not
include the Byte and Short data types when the JDBC 1.0 specification was
finalized. The mapping of SMALLINT and TINYINT to Integer is maintained
to preserve backwards compatibility.
Kris Jurka
http://jcp.org/aboutJava/communityprocess/final/jsr221/index.html
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: books@ejurka.com, davidclark@tx.rr.com
Subject: Re: Bug in org.postgresql.jdbc2.AbstractJdbc2ResultSet?
In-Reply-To: <Pine.BSO.4.64.0704301828260.28527@leary.csoft.net>
References: <200704301645.37898.davidclark@tx.rr.com> <Pine.BSO.4.64.0704301828260.28527@leary.csoft.net>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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