Re: Why is bool == java.sql.Types.BIT ??

Поиск
Список
Период
Сортировка
От Thomas Kellerer
Тема Re: Why is bool == java.sql.Types.BIT ??
Дата
Msg-id dm2umf$sga$1@sea.gmane.org
обсуждение исходный текст
Ответ на Re: Why is bool == java.sql.Types.BIT ??  (Kris Jurka <books@ejurka.com>)
Ответы Re: Why is bool == java.sql.Types.BIT ??  (Oliver Jowett <oliver@opencloud.com>)
Список pgsql-jdbc
Kris Jurka wrote on 23.11.2005 19:41:
>> I noticed that table columns that are defined as "bool" (Postgres
>> datatype) are reported as java.sql.Types.BIT through DatabaseMetadata
>> (or ResultSetMetaData).
>>
>> Is there any valid reason why they are not reported as
>> java.sql.Types.BOOLEAN?
>>
>
> Because BOOLEAN is only available to JDBC3.  Our driver still supports
> JDBC2 so we use BIT.  BOOLEAN and BIT are the same thing as far as we
> can tell.

Makes sense. I knew there was a reason :)

The problem comes when supporting multiple DBMS. With MS SQL Server a
bit column can only store 0/1 (which is not what the driver returns, as
it uses a java.lang.Boolean) but PG only accepts the literals
true/false. That's why I stumbled over this in the first place.

So I'll have to check the native type rather then the JDBC type to be sure.

Regards
Thomas

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

Предыдущее
От: Oliver Jowett
Дата:
Сообщение: Re: Logging from multiple connections
Следующее
От: Oliver Jowett
Дата:
Сообщение: Re: Why is bool == java.sql.Types.BIT ??