pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Oliver Jowett <oliver@opencloud.com>
To: Thomas Kellerer <spam_eater@gmx.net>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Why is bool == java.sql.Types.BIT ??
Date: Thu, 24 Nov 2005 12:50:15 +1300
Message-ID: <43850037.5000608@opencloud.com> (raw)
In-Reply-To: <dm2umf$sga$1@sea.gmane.org>
References: <dm29na$nrg$1@sea.gmane.org>
	<Pine.BSO.4.61.0511231340310.14387@leary.csoft.net>
	<dm2umf$sga$1@sea.gmane.org>

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



view thread (12+ messages)  latest in thread

Message-ID: <43850037.5000608@opencloud.com>
Permalink:  ../43850037.5000608@opencloud.com/
Also on:    postgresql.org/message-id/43850037.5000608@opencloud.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: oliver@opencloud.com, spam_eater@gmx.net
  Subject: Re: Why is bool == java.sql.Types.BIT ??
  In-Reply-To: <43850037.5000608@opencloud.com>
  References: <dm29na$nrg$1@sea.gmane.org> <Pine.BSO.4.61.0511231340310.14387@leary.csoft.net> <dm2umf$sga$1@sea.gmane.org> <43850037.5000608@opencloud.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox