dbTalk Databases Forums  

Re: [BUGS] BUG #1646: ERROR: column "mycolumn" is of type boolean

mailing.database.pgsql-bugs mailing.database.pgsql-bugs


Discuss Re: [BUGS] BUG #1646: ERROR: column "mycolumn" is of type boolean in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Oliver Jowett
 
Posts: n/a

Default Re: [BUGS] BUG #1646: ERROR: column "mycolumn" is of type boolean - 05-04-2005 , 04:54 PM






Kjh wrote:
Quote:
The following bug has been logged online:

Bug reference: 1646
Logged by: Kjh
Email address: kjh (AT) networks (DOT) nera.no
PostgreSQL version: 8.0
Operating system: windows XP
Description: ERROR: column "mycolumn" is of type boolean but
expression is of type character
Details:

newest drivers (JDBC3)
deployed it with JBoss 3.2.6

Indeed, the entity bean has fields of java-type Boolean and the database has
fields of type boolean, but the application server seems to send it to the
database as "true" or "false" strings. That is what the errormessage
indicates to me anyway: ERROR: column "mycolumn" is of type boolean but
expression is of type character. (Though I am not aware of how to verify
this other than changing column type varchar(5) which I have tried -
unfortunately, this had lots of other undesired side-effects even though it
worked in some cases.)
Which PreparedStatement.set...() method is being called to set the value
for this column?

To set a boolean-typed parameter, you shoud use
PreparedStatement.setBoolean(...), PreparedStatement.setObject(...,
Types.BIT), or PreparedStatement.setObject(..., Types.BOOLEAN).

If the application server is using setString() to send a boolean value,
that's where the bug lies.

-O

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.