> 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).
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
In response to
pgsql-jdbc by date
|Next:||From: Oliver Jowett||Date: 2005-12-19 23:28:48|
|Subject: Re: 8.2dev-500.jdbc3 driver: PreparedStatement.toString()|
|Previous:||From: Dave Cramer||Date: 2005-12-19 20:55:35|
|Subject: Re: Bug: Driver(8.2dev-500.jdbc3) does not handle boolean->BIT correctly|