|
26 | 26 | import java.sql.Types;
|
27 | 27 | import java.util.Vector;
|
28 | 28 |
|
29 |
| -/* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/jdbc1/Attic/AbstractJdbc1Statement.java,v 1.36 2003/09/13 04:02:15 barry Exp $ |
| 29 | +/* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/jdbc1/Attic/AbstractJdbc1Statement.java,v 1.37 2003/09/17 05:07:37 barry Exp $ |
30 | 30 | * This class defines methods of the jdbc1 specification. This class is
|
31 | 31 | * extended by org.postgresql.jdbc2.AbstractJdbc2Statement which adds the jdbc2
|
32 | 32 | * methods. The real Statement class (for jdbc1) is org.postgresql.jdbc1.Jdbc1Statement
|
@@ -917,7 +917,7 @@ public void setNull(int parameterIndex, int sqlType) throws SQLException
|
917 | 917 | */
|
918 | 918 | public void setBoolean(int parameterIndex, boolean x) throws SQLException
|
919 | 919 | {
|
920 |
| - bind(parameterIndex, x ? "'t'" : "'f'", PG_BOOLEAN); |
| 920 | + bind(parameterIndex, x ? "'1'" : "'0'", PG_BOOLEAN); |
921 | 921 | }
|
922 | 922 |
|
923 | 923 | /*
|
@@ -1551,11 +1551,15 @@ else if (x instanceof Integer || x instanceof Long ||
|
1551 | 1551 | case Types.BIT:
|
1552 | 1552 | if (x instanceof Boolean)
|
1553 | 1553 | {
|
1554 |
| - bind(parameterIndex, ((Boolean)x).booleanValue() ? "TRUE" : "FALSE", PG_TEXT); |
| 1554 | + bind(parameterIndex, ((Boolean)x).booleanValue() ? "'1'" : "'0'", PG_BOOLEAN); |
| 1555 | + } |
| 1556 | + else if (x instanceof String) |
| 1557 | + { |
| 1558 | + bind(parameterIndex, Boolean.valueOf(x.toString()).booleanValue() ? "'1'" : "'0'", PG_BOOLEAN); |
1555 | 1559 | }
|
1556 | 1560 | else if (x instanceof Number)
|
1557 | 1561 | {
|
1558 |
| - bind(parameterIndex, ((Number)x).intValue()==1 ? "TRUE" : "FALSE", PG_TEXT); |
| 1562 | + bind(parameterIndex, ((Number)x).intValue()==1 ? "'1'" : "'0'", PG_BOOLEAN); |
1559 | 1563 | }
|
1560 | 1564 | else
|
1561 | 1565 | {
|
|
0 commit comments