On Thu, 13 Sep 2001 15:29:38 -0400 (EDT), you wrote:
>> Bruce Momjian writes:
>> > I noticed that jdbc1 getBoolean allows '1', while jdbc2 does not.  The
>> > following patch makes jdbc2 accept '1' also.  Is this OK?
>> Why?  Booleans always come out as 't' or 'f'.
>Someone emailed me privately that they wanted to use '1' for 
>boolean. No idea why, and no idea why jdbc1 has it.

In jdbc1 the string to boolean conversion is implemented within
getBoolean() itself, which interprets data from the PostgreSQL

In jdbc2 its implemented in a helper method
ResultSet.toBoolean(), which is public, probably because its now
also used in the new Array feature.

Perhaps someone is now using ResultSet.toBoolean() as a utility
method. I don't think that's a good idea. Even though its public
its not part of any published interface. So anyone who wants to
convert 1 to true should use his own method. We could rule this
out by declaring the method protected or package (no access

This doesn't explain why jdbc1 accepts '1' though. Anyone?

René Pijlman <[EMAIL PROTECTED]>

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

Reply via email to