Ermengol Bota, 26.11.2012 14:00:
> Hello,
>
> sql.execute("Create Table jdbc_demo (b bit)");
> PreparedStatement pstmt = conn.prepareStatement("insert into jdbc_demo values (?)");
> pstmt.setBoolean(1,true); // There is no way to set a value for the bit field (or I don't know ... :-)
> pstmt.execute();
>
> Theorically (I think) it should works, but it answers:
>
> ERROR: column "b" is of type bit but expression is of type boolean
>
> We are working with PG 9.2.1 (one-click-installer on Ubuntu) and JDBC4 9.2-1002
>
> After trying a lot of different types for the pstmt.setXXXX(), we think that there is something not working well, or
weare missing something :-)
>
did you try
pstmt.setString(1, "1");
(I find the boolean type much more "descriptive" anyway for true/false columns)