From 9fafebd48789e1451879fc19c9f7b4290449c5d6 Mon Sep 17 00:00:00 2001 From: Ray Greenwell Date: Wed, 29 Sep 2010 18:31:31 +0000 Subject: [PATCH] Support creating arrays of java.sql.Date. --- .../java/com/samskivert/depot/impl/PostgreSQL4Builder.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/com/samskivert/depot/impl/PostgreSQL4Builder.java b/src/main/java/com/samskivert/depot/impl/PostgreSQL4Builder.java index 57ad6f7..1432b50 100644 --- a/src/main/java/com/samskivert/depot/impl/PostgreSQL4Builder.java +++ b/src/main/java/com/samskivert/depot/impl/PostgreSQL4Builder.java @@ -22,6 +22,7 @@ package com.samskivert.depot.impl; import java.sql.Array; import java.sql.Connection; +import java.sql.Date; import java.sql.PreparedStatement; import java.sql.SQLException; import java.sql.Timestamp; @@ -75,6 +76,8 @@ public class PostgreSQL4Builder extends PostgreSQLBuilder type = "smallint"; // tinyint is in the spec, but PG doesn't recognize? } else if (testValue instanceof Timestamp) { type = "timestamp"; + } else if (testValue instanceof Date) { + type = "date"; } else { throw new DatabaseException( "Don't know how to make Postgres array for " + testValue.getClass());