*/
public void setBoolean(int parameterIndex, boolean x) throws SQLException
{
- bind(parameterIndex, x ? "'t'" : "'f'", PG_BOOLEAN);
+ bind(parameterIndex, x ? "'1'" : "'0'", PG_BOOLEAN);
}
/*
case Types.BIT:
if (x instanceof Boolean)
{
- bind(parameterIndex, ((Boolean)x).booleanValue() ? "TRUE" : "FALSE", PG_TEXT);
+ bind(parameterIndex, ((Boolean)x).booleanValue() ? "'1'" : "'0'", PG_BOOLEAN);
+ }
+ else if (x instanceof String)
+ {
+ bind(parameterIndex, Boolean.valueOf(x.toString()).booleanValue() ? "'1'" : "'0'", PG_BOOLEAN);
}
else if (x instanceof Number)
{
- bind(parameterIndex, ((Number)x).intValue()==1 ? "TRUE" : "FALSE", PG_TEXT);
+ bind(parameterIndex, ((Number)x).intValue()==1 ? "'1'" : "'0'", PG_BOOLEAN);
}
else
{
{
throw org.postgresql.Driver.notImplemented();
}
+
+ public void setObject(int parameterIndex, Object x, int targetSqlType, int scale) throws SQLException
+ {
+ switch (targetSqlType)
+ {
+ case Types.BOOLEAN:
+ super.setObject(parameterIndex, x, Types.BIT, scale);
+ default:
+ super.setObject(parameterIndex, x, targetSqlType, scale);
+ }
+ }
}