diff --git a/src/interfaces/jdbc/org/postgresql/jdbc1/PreparedStatement.java b/src/interfaces/jdbc/org/postgresql/jdbc1/PreparedStatement.java index 84efeb09a0..e4c50f13af 100644 --- a/src/interfaces/jdbc/org/postgresql/jdbc1/PreparedStatement.java +++ b/src/interfaces/jdbc/org/postgresql/jdbc1/PreparedStatement.java @@ -489,6 +489,17 @@ public class PreparedStatement extends Statement implements java.sql.PreparedSta case Types.TIMESTAMP: setTimestamp(parameterIndex, (Timestamp)x); break; + case Types.BIT: + if (x instanceof Boolean) { + set(parameterIndex, ((Boolean)x).booleanValue() ? "TRUE" : "FALSE"); + } else { + throw new PSQLException("postgresql.prep.type"); + } + break; + case Types.BINARY: + case Types.VARBINARY: + setObject(parameterIndex,x); + break; case Types.OTHER: setString(parameterIndex, ((PGobject)x).getValue()); break; diff --git a/src/interfaces/jdbc/org/postgresql/jdbc1/ResultSet.java b/src/interfaces/jdbc/org/postgresql/jdbc1/ResultSet.java index 98af07b0b6..bfbded0f01 100644 --- a/src/interfaces/jdbc/org/postgresql/jdbc1/ResultSet.java +++ b/src/interfaces/jdbc/org/postgresql/jdbc1/ResultSet.java @@ -806,6 +806,9 @@ public class ResultSet extends org.postgresql.ResultSet implements java.sql.Resu return getTime(columnIndex); case Types.TIMESTAMP: return getTimestamp(columnIndex); + case Types.BINARY: + case Types.VARBINARY: + return getBytes(columnIndex); default: return connection.getObject(field.getTypeName(), getString(columnIndex)); } diff --git a/src/interfaces/jdbc/org/postgresql/jdbc2/PreparedStatement.java b/src/interfaces/jdbc/org/postgresql/jdbc2/PreparedStatement.java index f204490533..af73fee362 100644 --- a/src/interfaces/jdbc/org/postgresql/jdbc2/PreparedStatement.java +++ b/src/interfaces/jdbc/org/postgresql/jdbc2/PreparedStatement.java @@ -549,6 +549,17 @@ public class PreparedStatement extends Statement implements java.sql.PreparedSta case Types.TIMESTAMP: setTimestamp(parameterIndex, (Timestamp)x); break; + case Types.BIT: + if (x instanceof Boolean) { + set(parameterIndex, ((Boolean)x).booleanValue() ? "TRUE" : "FALSE"); + } else { + throw new PSQLException("postgresql.prep.type"); + } + break; + case Types.BINARY: + case Types.VARBINARY: + setObject(parameterIndex,x); + break; case Types.OTHER: setString(parameterIndex, ((PGobject)x).getValue()); break; diff --git a/src/interfaces/jdbc/org/postgresql/jdbc2/ResultSet.java b/src/interfaces/jdbc/org/postgresql/jdbc2/ResultSet.java index 81605deec8..5bf11e3c3e 100644 --- a/src/interfaces/jdbc/org/postgresql/jdbc2/ResultSet.java +++ b/src/interfaces/jdbc/org/postgresql/jdbc2/ResultSet.java @@ -855,6 +855,9 @@ public class ResultSet extends org.postgresql.ResultSet implements java.sql.Resu return getTime(columnIndex); case Types.TIMESTAMP: return getTimestamp(columnIndex); + case Types.BINARY: + case Types.VARBINARY: + return getBytes(columnIndex); default: return connection.getObject(field.getTypeName(), getString(columnIndex)); }