Index: AbstractJdbc4Statement.java =================================================================== RCS file: /cvsroot/jdbc/pgjdbc/org/postgresql/jdbc4/AbstractJdbc4Statement.java,v retrieving revision 1.7 diff -u -r1.7 AbstractJdbc4Statement.java --- AbstractJdbc4Statement.java 2 Aug 2011 13:49:23 -0000 1.7 +++ AbstractJdbc4Statement.java 20 Jan 2012 19:05:26 -0000 @@ -40,11 +40,15 @@ public void setObject(int parameterIndex, Object x) throws SQLException { if (x instanceof SQLXML) - { setSQLXML(parameterIndex, (SQLXML)x); - } else { + else if (x instanceof List) + setArray(parameterIndex, (List)x); + else if (x instanceof Object[]) + setArray(parameterIndex, (Object[])x); + else if (x.getClass().isArray()) + setArray(parameterIndex, (Object)x); + else super.setObject(parameterIndex, x); - } } public void setObject(int parameterIndex, Object x, int targetSqlType, int scale) throws SQLException @@ -391,5 +395,101 @@ { throw org.postgresql.Driver.notImplemented(this.getClass(), "getObject(String, Class)"); } - + + private void setArray(int i, List x) throws SQLException { + setArray(i, x.toArray()); + } + + private void setArray(int i, Object[] x) throws SQLException { + String typename=null; + Object o; + if (x.getClass().equals(Object[].class)) + { + // make sure all values of the same type + o=x[0]; + for (int j=1;j