Index: org/postgresql/jdbc2/AbstractJdbc2Statement.java =================================================================== RCS file: /cvsroot/jdbc/pgjdbc/org/postgresql/jdbc2/AbstractJdbc2Statement.java,v retrieving revision 1.114 diff -u -8 -p -r1.114 AbstractJdbc2Statement.java --- org/postgresql/jdbc2/AbstractJdbc2Statement.java 27 May 2009 23:55:19 -0000 1.114 +++ org/postgresql/jdbc2/AbstractJdbc2Statement.java 5 Aug 2009 09:30:00 -0000 @@ -1224,16 +1224,36 @@ public abstract class AbstractJdbc2State */ public void setDouble(int parameterIndex, double x) throws SQLException { checkClosed(); bindLiteral(parameterIndex, Double.toString(x), Oid.FLOAT8); } /* + * Set a parameter to a java.lang.BigInteger value. The driver + * converts this to a SQL NUMERIC value when it sends it to the + * database. + * + * This is an extension to the JDBC API! + * + * @param parameterIndex the first parameter is 1... + * @param x the parameter value + * @exception SQLException if a database access error occurs + */ + public void setBigInteger(int parameterIndex, BigInteger x) throws SQLException + { + checkClosed(); + if (x == null) + setNull(parameterIndex, Types.DECIMAL); + else + bindLiteral(parameterIndex, x.toString(), Oid.NUMERIC); + } + + /* * Set a parameter to a java.lang.BigDecimal value. The driver * converts this to a SQL NUMERIC value when it sends it to the * database. * * @param parameterIndex the first parameter is 1... * @param x the parameter value * @exception SQLException if a database access error occurs */ @@ -1731,16 +1751,18 @@ public abstract class AbstractJdbc2State { checkClosed(); if (x == null) setNull(parameterIndex, Types.OTHER); else if (x instanceof String) setString(parameterIndex, (String)x); else if (x instanceof BigDecimal) setBigDecimal(parameterIndex, (BigDecimal)x); + else if (x instanceof BigInteger) + setBigInteger(parameterIndex, (BigInteger)x); else if (x instanceof Short) setShort(parameterIndex, ((Short)x).shortValue()); else if (x instanceof Integer) setInt(parameterIndex, ((Integer)x).intValue()); else if (x instanceof Long) setLong(parameterIndex, ((Long)x).longValue()); else if (x instanceof Float) setFloat(parameterIndex, ((Float)x).floatValue());