UPDATED Re: ToBoolean method return correct Boolean values as per JDBC spec - Mailing list pgsql-jdbc

From Kim Ho
Subject UPDATED Re: ToBoolean method return correct Boolean values as per JDBC spec
Date
Msg-id 1057257319.4299.33.camel@topanga.toronto.redhat.com
Whole thread Raw
In response to ToBoolean method return correct Boolean values as per JDBC spec  (Kim Ho <kho@redhat.com>)
List pgsql-jdbc
On Wed, 2003-06-18 at 14:02, Kim Ho wrote:
> Problem:
> - The toBoolean() method treats all input strings that start with T, t,
> or 1 as true. For instance, "The sun is not a star." is evaluated as
> true...
> However, booleans are only supposed to be true if the
> value of the input string is equalsignorecase "True".
> I've left in a single character string "1" and
> a single character string "t" (or "T") for backwards compatibility.
>
> new Boolean("this is not a boolean") produces a Boolean object that
> represents false.
>
Now accepts things like 1.0 from Double columns and whatnot.

> However, when you insert 'this is not a boolean' into a CHAR column and
> use getBoolean to extract it, it returns true.
>
> Fix:
>  - Different check in toBoolean()
>

Attachment

pgsql-jdbc by date:

Previous
From: "Roman Fail"
Date:
Subject: No timeout to establish Connection?
Next
From: "Roman Fail"
Date:
Subject: Re: No timeout to establish Connection?