On Tue, 6 Dec 2005, Michael Paesold wrote:
> Another question that occurred to me is, how should I tell the driver to
> specify a type as "undefined" or "unknown" to the server?
>
> Some random tries that did not work:
> stmt.setObject(2, "1 month", java.sql.Types.OTHER);
> --> Cannot cast an instance of String to type Types.OTHER
You can use
stmt.setObject(2, new org.postgresql.util.PGInterval("1 month"));
or you could try this which I have not tested:
PGobject o = new org.postgresql.util.PGobject("1 month");
o.setType("unknown");
stmt.setObject(2, o);
Kris Jurka