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

From: Oliver Jowett <oliver(at)opencloud(dot)com>
To: Thomas Kellerer <spam_eater(at)gmx(dot)net>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Why is bool == java.sql.Types.BIT ??
Date: 2005-11-23 23:50:15
Message-ID: 43850037.5000608@opencloud.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

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.

-O

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Oliver Jowett 2005-11-24 02:34:36 Re: Logging from multiple connections
Previous Message Thomas Kellerer 2005-11-23 23:41:03 Re: Why is bool == java.sql.Types.BIT ??