Subject | Re: [IB-Java] Re: FBResultSet.getBoolean |
---|---|
Author | Massimo Ferrari |
Post date | 2002-02-11T20:13:07Z |
> > bool b = "YyTt1Oo".indexOf(value.charAt(0))!=-1; ?but if value = "true" -> value.charAt(0) is 't'
>
> It is quite ok, if the column containing the data can be casted to
> CHAR(1). What do we do with other (for example, CHAR(5)
> containing 'true' and 'false')?
and "YyTt1Oo".indexOf('t') is 3
> And how to specify the backwardAs far as I understand a JDBC driver (and it's not that far... :) ) I would
> conversion in PreparedStatement.setBoolean(...) if the column in CHAR
> (5)?
say
that setBoolean on a numeric field should set either 0 or 1, and setBoolean
on
a CHAR field should set simply and always "T" or "F".
The code proposed above is just to make the driver able to translate to a
boolean
more strings pattern than just t/true and f/false.
... anyway since this answer is quite trivial I think I didn't understand
your question
Massimo