Re: JDBC: 2 bugs: Getting a smallint array actually gets an integer array and return type of a boolean array is bit.

Поиск
Список
Период
Сортировка
От Kevin Grittner
Тема Re: JDBC: 2 bugs: Getting a smallint array actually gets an integer array and return type of a boolean array is bit.
Дата
Msg-id 4C29B6FD0200002500032CBC@gw.wicourts.gov
обсуждение исходный текст
Ответ на JDBC: 2 bugs: Getting a smallint array actually gets an integer array and return type of a boolean array is bit.  (Saneesh Apte <san@calccit.org>)
Список pgsql-bugs
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

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Marcel Asio
Дата:
Сообщение: Function works in 8.4 but not in 9.0 beta2 "ERROR: structure of query does not match function result type"
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Function works in 8.4 but not in 9.0 beta2 "ERROR: structure of query does not match function result type"