Inserting an Interval Using JDBC

From: Will Szopko <dba(at)vilaj(dot)com>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Inserting an Interval Using JDBC
Date: 2006-01-23 17:02:17
Message-ID: 43D50C19.9040408@vilaj.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

My apologies if there's a simple answer to my problem, but I've looked
and looked and can't figure it out.

I have just upgraded to the 8.1-404 version of the JDBC driver from a
much older version. In the past I had been able load an interval into my
database by sending it as a string, as such:

String myInterval = "08:00"; // 8 hour interval
...
stmt.setString(1, myInterval);

Using the new driver I am no longer able to do this and get the
following error:

column "num_hours" is of type interval but expression is of type text

I have looked through the driver source code, but don't see that I could
send the value as an "object" or as one of the other time-related types.
If someone might be able to point me to a solution to this problem, I'd
be most appreciative.

Thanks.

- Will

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message balpo (sent by Nabble.com) 2006-01-23 19:22:32 Re: RFP: Finish JDBC driver
Previous Message Prasanth 2006-01-20 17:55:22 Re: getDate after call to updateDate