Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 5F2DF632305 for ; Tue, 29 Jun 2010 13:59:33 -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 92637-03 for ; Tue, 29 Jun 2010 16:59:26 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail63.csoft.net (mail63.csoft.net [205.205.214.4]) by mail.postgresql.org (Postfix) with ESMTP id 6FEDE63225A for ; Tue, 29 Jun 2010 13:59:26 -0300 (ADT) Received: from mail63.csoft.net (localhost [127.0.0.1]) by mail63.csoft.net (Postfix) with ESMTP id 8049E2841D; Tue, 29 Jun 2010 12:59:23 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=csoft.net; h=date:from:to :cc:subject:in-reply-to:message-id:references:mime-version :content-type; s=sel1; bh=HOS92P7o/I4FurTqofcP+1oaUaA=; b=Um3lAf mNbxmj43r5TtWyxNEqBnUIc9Y/TifrmVuWWJJXMlvXTuFmnjnjGsKKPorNnc6fBf I8y1uSH4rctQiR+XKwCubwa9jr3+xeQ0mUHH/4qgArCQ+ra/vRXPMFSMyaYlm477 qU8PH6dHgwy0ZuIVMCtwF/9XWKzl0qUWQBvDQ= Received: from leary.csoft.net (leary.csoft.net [205.205.214.5]) by mail63.csoft.net (Postfix) with ESMTP id 7D69728417; Tue, 29 Jun 2010 12:59:22 -0400 (EDT) Received: by leary.csoft.net (Postfix, from userid 1112) id 4D103A1FF; Tue, 29 Jun 2010 12:59:22 -0400 (EDT) Date: Tue, 29 Jun 2010 12:59:22 -0400 (EDT) From: Kris Jurka X-X-Sender: books@leary.csoft.net To: Saneesh Apte cc: pgsql-bugs@postgresql.org Subject: Re: [JDBC] JDBC: 2 bugs: Getting a smallint array actually gets an integer array and return type of a boolean array is bit. In-Reply-To: <4C295503.5020506@calccit.org> Message-ID: References: <4C295503.5020506@calccit.org> User-Agent: Alpine 2.00 (BSO 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; format=flowed; charset=US-ASCII X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.51 tagged_above=-5 required=5 tests=BAYES_05=-0.5, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201006/362 X-Sequence-Number: 27323 On Mon, 28 Jun 2010, Saneesh Apte wrote: > 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? These are aliases for the same type. I believe we accept either BOOLEAN or BIT as equivalent in all cases. We default to BIT for historical reasons because it was defined first in the JDBC2 spec while BOOLEAN came around in the JDBC3 version. > And secondly the returned type from a smallint[] is an Integer[] > instead of a Short[]. > The JDBC spec says that the result of getObject on a Types.SMALLINT value should return Integer, so we have followed that for array types as well. The spec contains this historical 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 For more information see table B-3 in the JDBC4.0 spec. Kris Jurka