pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: j.random.programmer <javadesigner@yahoo.com>
To: Dave Cramer <pg@fastcrypt.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Bug: Driver(8.2dev-500.jdbc3) does not handle boolean->BIT correctly
Date: Mon, 19 Dec 2005 14:09:37 -0800 (PST)
Message-ID: <20051219220938.81809.qmail@web32001.mail.mud.yahoo.com> (raw)
In-Reply-To: <81D78292-95EC-44DD-B4CE-D9708D42F21B@fastcrypt.com>

Dave:

> The problem is that we don't know in advance if the
> underlying column  
> is a bit, or a boolean. Postgresql supports 
> both, the jdbc API   doesn't appear to.

You can get from the database the actual
type defined in the database for that column
right ? (so if it's BIT your driver can tell it's
BIT in the database, I presume).

So then, as per the JDBC spec
1) while retrieving:
convert that BIT (however long it may be) into a
boolean [true, say, it it's all 1's else false]. 
2) while saving:
convert java true to a '1' and save that as a BIT
(convert java false to '0').

That's what the spec suggests from what I can
tell. Of course, you could also convert the
BIT into a string if the user wants it as a string).

Best regards,
--j

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 



view thread (14+ messages)  latest in thread

Message-ID: <20051219220938.81809.qmail@web32001.mail.mud.yahoo.com>
Permalink:  ../20051219220938.81809.qmail@web32001.mail.mud.yahoo.com/
Also on:    postgresql.org/message-id/20051219220938.81809.qmail@web32001.mail.mud.yahoo.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: javadesigner@yahoo.com, pg@fastcrypt.com
  Subject: Re: Bug: Driver(8.2dev-500.jdbc3) does not handle boolean->BIT correctly
  In-Reply-To: <20051219220938.81809.qmail@web32001.mail.mud.yahoo.com>
  References: <81D78292-95EC-44DD-B4CE-D9708D42F21B@fastcrypt.com> <20051219220938.81809.qmail@web32001.mail.mud.yahoo.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