This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes JDBC and the fly likes Bit -boolean mismatch in postgresql jdbc 9.0-801 driver? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Bit -boolean mismatch in postgresql jdbc 9.0-801 driver?" Watch "Bit -boolean mismatch in postgresql jdbc 9.0-801 driver?" New topic
Author

Bit -boolean mismatch in postgresql jdbc 9.0-801 driver?

Vic Hood
Ranch Hand

Joined: Jan 05, 2011
Posts: 477

Hi Folks,
I've been using PostGresql for my database . And had been using postgresql 7.4.1jdbc3.jar up until last week , I recently upgraded to jdbc 9.0-801jdbc4.jar and began having problems with the bit fields in my database .
Earlier the following code used to work seamlessly.

where getActive and getEdit are functions that return boolean type.The columns isactive and isedit are of type bit in the DB side.The values of 0 and 1 are inserted into the database when true and false are passed to them respectively.
But upon trying the new jdbc jar . I faced the following exception
--
org.postgresql.util.PSQLException: ERROR: column "isactive" is of type bit but expression is of type boolean
Hint: You will need to rewrite or cast the expression....

I did read up a little on the issue ,but havent found any concrete suggestions . Is changing the datatype of the coloumn to boolean the only option??
Thanks in advance.


Learning and Learning!-- Java all the way!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Bit -boolean mismatch in postgresql jdbc 9.0-801 driver?