pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Thomas Kellerer <spam_eater@gmx.net>
To: pgsql-jdbc@postgresql.org
Subject: Re: Why is bool == java.sql.Types.BIT ??
Date: Thu, 24 Nov 2005 17:34:00 +0100
Message-ID: <dm4q1m$qk1$1@sea.gmane.org> (raw)
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>

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




view thread (12+ messages)  latest in thread

Message-ID: <dm4q1m$qk1$1@sea.gmane.org>
Permalink:  ../dm4q1m$qk1$1@sea.gmane.org/
Also on:    postgresql.org/message-id/dm4q1m$qk1$1@sea.gmane.org

 · 

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: spam_eater@gmx.net
  Subject: Re: Why is bool == java.sql.Types.BIT ??
  In-Reply-To: <dm4q1m$qk1$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> <43850037.5000608@opencloud.com> <dm4q1m$qk1$1@sea.gmane.org>

* 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