Subject Re: [IB-Java] Re: FBResultSet.getBoolean
Author Massimo Ferrari
> > bool b = "YyTt1Oo".indexOf(value.charAt(0))!=-1; ?
> 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')?
but if value = "true" -> value.charAt(0) is 't'
and "YyTt1Oo".indexOf('t') is 3

> And how to specify the backward
> conversion in PreparedStatement.setBoolean(...) if the column in CHAR
> (5)?
As far as I understand a JDBC driver (and it's not that far... :) ) I would
that setBoolean on a numeric field should set either 0 or 1, and setBoolean
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
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