From: Kevin Grittner <Kevin.Grittner@wicourts.gov>
To: Saneesh Apte <san@calccit.org>
To: pgsql-bugs@postgresql.org
Subject: Re: JDBC: 2 bugs: Getting a smallint array actually gets an integer array and return type of a boolean array is bit.
Date: Tue, 29 Jun 2010 09:03:57 -0500
Message-ID: <4C29B6FD0200002500032CBC@gw.wicourts.gov> (raw)
In-Reply-To: <4C295503.5020506@calccit.org>
References: <4C295503.5020506@calccit.org>
Saneesh Apte <san@calccit.org> wrote:
> 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?
>
> And secondly the returned type from a smallint[] is an Integer[]
> instead of a Short[].
Should the objects in the array returned by getArray be typed
according to the rules of an individual value returned by getObject?
(I couldn't find anything explicit on that, but it seems
reasonable.) If that *is* true, the controlling part of the spec
is:
http://java.sun.com/javase/6/docs/technotes/guides/jdbc/getstart/mapping.html#table3
That maps SQL types TINYINT, SMALLINT, AND INTEGER to Java Integer.
It also maps SQL BIT to Java Boolean. The SQL type of BOOLEAN was a
latecomer to the SQL spec, and it appears that JDBC hasn't yet added
it to the mappings.
Do you have a reference to something which indicates that getArray
should use a different mapping?
Maybe someone will see it differently, but I don't think I see a bug
here. Compliance with the spec is not a bug, even if the spec is a
bit odd.... ;-)
-Kevin
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: Kevin.Grittner@wicourts.gov, san@calccit.org, pgsql-bugs@postgresql.org
Subject: Re: JDBC: 2 bugs: Getting a smallint array actually gets an integer array and return type of a boolean array is bit.
In-Reply-To: <4C29B6FD0200002500032CBC@gw.wicourts.gov>
References: <4C295503.5020506@calccit.org> <4C29B6FD0200002500032CBC@gw.wicourts.gov>
* 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