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

From: aditsu <aditsu(at)yahoo(dot)com>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Why is bool == java.sql.Types.BIT ??
Date: 2011-05-24 09:20:47
Message-ID: 1306228847962-4421529.post@n5.nabble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc


Kris Jurka wrote:
>
> On Wed, 23 Nov 2005, Thomas Kellerer wrote:
>
>> 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.
>

Hi, apologies in case this gets posted twice.
I know this is an old thread, but I just hit this problem now and have the
same question. I'm currently using postgresql-9.0-801.jdbc4.jar and can't
see any reason not to use BOOLEAN.
boolean and bit are not interchangeable or even compatible (except
semantically); it definitely looks like a bug to me.

Adrian

--
View this message in context: http://postgresql.1045698.n5.nabble.com/Why-is-bool-java-sql-Types-BIT-tp2169629p4421529.html
Sent from the PostgreSQL - jdbc mailing list archive at Nabble.com.

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Oliver Jowett 2011-05-24 10:41:03 Re: Why is bool == java.sql.Types.BIT ??
Previous Message Marc-André Laverdière 2011-05-24 04:56:10 Re: Support for cert auth in JDBC