Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 7226D632763 for ; Tue, 29 Jun 2010 22:34:55 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 58993-08; Wed, 30 Jun 2010 01:34:46 +0000 (UTC) X-Greylist: delayed 00:23:59.803689 by SQLgrey-1.7.6 X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from tremor.opencloud.co.nz (tremor.opencloud.co.nz [131.203.101.230]) by mail.postgresql.org (Postfix) with ESMTP id 527466325EA; Tue, 29 Jun 2010 22:34:48 -0300 (ADT) Received: from 121-98-80-66.bitstream.orcon.net.nz ([121.98.80.66] helo=[192.168.1.2]) by tremor.opencloud.co.nz with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1OTlp3-0008Rl-RU; Wed, 30 Jun 2010 13:10:41 +1200 Message-ID: <4C2A9989.2050302@opencloud.com> Date: Wed, 30 Jun 2010 13:10:33 +1200 From: Oliver Jowett User-Agent: Thunderbird 2.0.0.24 (Windows/20100228) MIME-Version: 1.0 To: Saneesh Apte CC: pgsql-bugs@postgresql.org, PostgreSQL - JDBC Subject: Re: [JDBC] JDBC: 2 bugs: Getting a smallint array actually gets an integer array and return type of a boolean array is bit. References: <4C295503.5020506@calccit.org> In-Reply-To: <4C295503.5020506@calccit.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.8 tagged_above=-5 required=5 tests=BAYES_50=0.8 X-Spam-Level: X-Archive-Number: 201006/370 X-Sequence-Number: 27331 Saneesh Apte wrote: > I think I found two bugs (and I hope I am not wasting everyone's time). > One is minor: the base type of a boolean[] is java.sql.Types.BIT > instead or java.sql.Types.BOOLEAN. At the very least shouldn't these be > aliases for the same type? Types.BOOLEAN does not exist before JDBC3. Client code can use either, but we have to pick one or the other when returning a value, so we return BIT. > And secondly the returned type from a smallint[] is an Integer[] > instead of a Short[]. smallint is a Types.SMALLINT which is mapped to java.lang.Integer by the JDBC spec. See appendix B of the spec: > 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. -O