Index: org/postgresql/jdbc2/AbstractJdbc2Array.java =================================================================== RCS file: /usr/local/cvsroot/pgjdbc/pgjdbc/org/postgresql/jdbc2/AbstractJdbc2Array.java,v retrieving revision 1.18 diff -u -p -r1.18 AbstractJdbc2Array.java --- org/postgresql/jdbc2/AbstractJdbc2Array.java 4 Dec 2005 21:40:33 -0000 1.18 +++ org/postgresql/jdbc2/AbstractJdbc2Array.java 5 Jul 2007 14:56:50 -0000 @@ -185,8 +185,10 @@ public class AbstractJdbc2Array break; case Types.NUMERIC: retVal = new BigDecimal[ count ]; - for ( ; count > 0; count-- ) - ((BigDecimal[])retVal)[i++] = AbstractJdbc2ResultSet.toBigDecimal( arrayContents[(int)index++], -1 ); + for ( ; count > 0; count-- ){ + String content = arrayContents[(int)index++]; + ((BigDecimal[])retVal)[i++] = ("NULL".equals(content)) ? null : AbstractJdbc2ResultSet.toBigDecimal( content, -1 ); + } break; case Types.REAL: retVal = new float[ count ]; @@ -201,23 +203,31 @@ public class AbstractJdbc2Array case Types.CHAR: case Types.VARCHAR: retVal = new String[ count ]; - for ( ; count > 0; count-- ) - ((String[])retVal)[i++] = arrayContents[(int)index++]; + for ( ; count > 0; count-- ){ + String content = arrayContents[(int)index++]; + ((String[])retVal)[i++] = ("NULL".equals(content)) ? null : content; + } break; case Types.DATE: retVal = new java.sql.Date[ count ]; - for ( ; count > 0; count-- ) - ((java.sql.Date[])retVal)[i++] = conn.getTimestampUtils().toDate(null, arrayContents[(int)index++] ); + for ( ; count > 0; count-- ){ + String content = arrayContents[(int)index++]; + ((java.sql.Date[])retVal)[i++] = ("NULL".equals(content)) ? null : conn.getTimestampUtils().toDate(null, content ); + } break; case Types.TIME: retVal = new java.sql.Time[ count ]; - for ( ; count > 0; count-- ) - ((java.sql.Time[])retVal)[i++] = conn.getTimestampUtils().toTime(null, arrayContents[(int)index++] ); + for ( ; count > 0; count-- ){ + String content = arrayContents[(int)index++]; + ((java.sql.Time[])retVal)[i++] = ("NULL".equals(content)) ? null : conn.getTimestampUtils().toTime(null, content ); + } break; case Types.TIMESTAMP: retVal = new Timestamp[ count ]; - for ( ; count > 0; count-- ) - ((java.sql.Timestamp[])retVal)[i++] = conn.getTimestampUtils().toTimestamp(null, arrayContents[(int)index++] ); + for ( ; count > 0; count-- ){ + String content = arrayContents[(int)index++]; + ((java.sql.Timestamp[])retVal)[i++] = ("NULL".equals(content)) ? null : conn.getTimestampUtils().toTimestamp(null, content ); + } break; // Other datatypes not currently supported. If you are really using other types ask