preparedStatement.setObject(i, value);
where value is of type Boolean (with valid i and value equaled to false
below)and created the column associated with that value as type BIT and I'm
getting the following exception when the preparedStatement is executed.
java.sql.SQLException: ERROR: zpbit_in: t is not a valid bitstring
at org.postgresql.Connection.ExecSQL(Connection.java:393)
at org.postgresql.jdbc2.Statement.execute(Statement.java:273)
at org.postgresql.jdbc2.Statement.executeUpdate(Statement.java:73)
at
org.postgresql.jdbc2.PreparedStatement.executeUpdate(PreparedStatement.java:
126)
at Database.insert(Database.java:205)
. . .
Any help would be appreciated.
Thanks, Ian
If you want to store true/false values in Postgresql then the column of the
table should be of type "bool", not "bit". (The type "bit" means different
things in different DBMSs. Postgresql uses the meaning defined in the ANSI
SQL standard.)