Index: src/interfaces/jdbc/org/postgresql/jdbc1/PreparedStatement.java =================================================================== RCS file: /home/projects/pgsql/cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/jdbc1/PreparedStatement.java,v retrieving revision 1.5 diff -c -r1.5 PreparedStatement.java *** src/interfaces/jdbc/org/postgresql/jdbc1/PreparedStatement.java 2001/01/24 23:41:04 1.5 --- src/interfaces/jdbc/org/postgresql/jdbc1/PreparedStatement.java 2001/05/16 17:18:01 *************** *** 455,460 **** --- 455,464 ---- */ public void setObject(int parameterIndex, Object x, int targetSqlType, int scale) throws SQLException { + if (x == null){ + setNull(parameterIndex,Types.OTHER); + return; + } switch (targetSqlType) { case Types.TINYINT: *************** *** 506,511 **** --- 510,519 ---- */ public void setObject(int parameterIndex, Object x) throws SQLException { + if (x == null){ + setNull(parameterIndex,Types.OTHER); + return; + } if (x instanceof String) setString(parameterIndex, (String)x); else if (x instanceof BigDecimal) Index: src/interfaces/jdbc/org/postgresql/jdbc2/PreparedStatement.java =================================================================== RCS file: /home/projects/pgsql/cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/PreparedStatement.java,v retrieving revision 1.9 diff -c -r1.9 PreparedStatement.java *** src/interfaces/jdbc/org/postgresql/jdbc2/PreparedStatement.java 2001/02/16 16:45:00 1.9 --- src/interfaces/jdbc/org/postgresql/jdbc2/PreparedStatement.java 2001/05/16 17:18:01 *************** *** 515,520 **** --- 515,524 ---- */ public void setObject(int parameterIndex, Object x, int targetSqlType, int scale) throws SQLException { + if (x == null){ + setNull(parameterIndex,Types.OTHER); + return; + } switch (targetSqlType) { case Types.TINYINT: *************** *** 566,571 **** --- 570,579 ---- */ public void setObject(int parameterIndex, Object x) throws SQLException { + if (x == null){ + setNull(parameterIndex,Types.OTHER); + return; + } if (x instanceof String) setString(parameterIndex, (String)x); else if (x instanceof BigDecimal)