Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id C2C8C9FB2AC for ; Mon, 30 Apr 2007 18:58:06 -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 51451-07 for ; Mon, 30 Apr 2007 18:57:54 -0300 (ADT) X-Greylist: delayed 00:12:15.057337 by SQLgrey-1.7.4 Received: from mta11.adelphia.net (mta11.adelphia.net [68.168.78.205]) by postgresql.org (Postfix) with ESMTP id C9A019FA061 for ; Mon, 30 Apr 2007 18:57:58 -0300 (ADT) Received: from [192.168.0.102] (really [76.183.12.24]) by mta16.adelphia.net (InterMail vM.6.01.05.04 201-2131-123-105-20051025) with ESMTP id <20070430214541.BGXA26916.mta16.adelphia.net@[192.168.0.102]> for ; Mon, 30 Apr 2007 17:45:41 -0400 From: David Clark To: pgsql-jdbc@postgresql.org Subject: Bug in org.postgresql.jdbc2.AbstractJdbc2ResultSet? Date: Mon, 30 Apr 2007 16:45:37 -0500 User-Agent: KMail/1.9.5 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200704301645.37898.davidclark@tx.rr.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200704/139 X-Sequence-Number: 16988 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. Patch: --- AbstractJdbc2ResultSet.java 2007-04-16 11:37:04.000000000 -0500 +++ AbstractJdbc2ResultSet.java.patched 2007-04-30 15:52:51.000000000 -0500 @@ -117,6 +117,7 @@ return getBoolean(columnIndex) ? Boolean.TRUE : Boolean.FALSE; case Types.TINYINT: case Types.SMALLINT: + return new Short(getShort(columnIndex)); case Types.INTEGER: return new Integer(getInt(columnIndex)); case Types.BIGINT: David Clark