Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id B66EE9FB8C5 for ; Mon, 30 Apr 2007 19:34:39 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 57794-05 for ; Mon, 30 Apr 2007 19:34:25 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from mail63.csoft.net (leary.csoft.net [205.205.214.5]) by postgresql.org (Postfix) with SMTP id E8C609FB8C9 for ; Mon, 30 Apr 2007 19:34:29 -0300 (ADT) Received: (qmail 15519 invoked by uid 1112); 30 Apr 2007 22:34:27 -0000 Date: Mon, 30 Apr 2007 18:34:27 -0400 (EDT) From: Kris Jurka X-X-Sender: books@leary.csoft.net To: David Clark cc: pgsql-jdbc@postgresql.org Subject: Re: Bug in org.postgresql.jdbc2.AbstractJdbc2ResultSet? In-Reply-To: <200704301645.37898.davidclark@tx.rr.com> Message-ID: References: <200704301645.37898.davidclark@tx.rr.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200704/140 X-Sequence-Number: 16989 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