Re: Why is bool == java.sql.Types.BIT ?? - Mailing list pgsql-jdbc

From Thomas Kellerer
Subject Re: Why is bool == java.sql.Types.BIT ??
Date
Msg-id dm4q1m$qk1$1@sea.gmane.org
Whole thread Raw
In response to Re: Why is bool == java.sql.Types.BIT ??  (Oliver Jowett <oliver@opencloud.com>)
Responses Re: Why is bool == java.sql.Types.BIT ??
List pgsql-jdbc
Oliver Jowett wrote on 24.11.2005 00:50:
> Thomas Kellerer wrote:
>
>> 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.
>
>
> Can't you use setBoolean()/getBoolean()? I think that's specified to
> always work on a BIT column, whatever the real underlying type is.
>

Yes of course I can and actually I do when using PreparedStatements
But when I'm generating SQL Scripts I need to use the correct literal
for such a column.

Regards
Thomas

pgsql-jdbc by date:

Previous
From: Roman Chervotkin
Date:
Subject: org.postgresql.util.PSQLException Column name candidates.id wasn't found in the ResultSet
Next
From: Kris Jurka
Date:
Subject: Re: org.postgresql.util.PSQLException Column name candidates.id