A search of the forum may turn up a better answer, but:
I searched "the web" :-D and I just found the code below that it's supposed to work. I thought that the patch sended was included "by default" in newer jdbc versions...
So the first problem with your execution above is you have tried to
insert a PostgreSQL boolean type into a defined PostgreSQL bit type. You definition is actually by default bit(1), it could have been bit(2) has the example bit2_type above. Can not use setBoolean() with bit type in the way you have tried.
The one way that it can be done has I have seen before would be to do a CAST.
pstmt = con.prepareStatement("INSERT INTO jdbc_demo VALUES (?::bit)"); pstmt.setString(1, "1");
This way works! great :-)
I'm not used to do cast conversion on the prepareStatement definition, thank you for the clue!
Now I see that I didn't understand the hint at the error message "Hint: You will need to rewrite or cast the expression."
Thanks a lot.
-- * Ermengol * ************************************************* * Els ordinadors no resolen problemes, * * simplement executen solucions * *************************************************