File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases 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 Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Bit -boolean mismatch in postgresql jdbc 9.0-801 driver?" Watch "Bit -boolean mismatch in postgresql jdbc 9.0-801 driver?" New topic

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:
subject: Bit -boolean mismatch in postgresql jdbc 9.0-801 driver?
It's not a secret anymore!