From: Will Szopko <dba@vilaj.com>
To: pgsql-jdbc@postgresql.org
Subject: Inserting an Interval Using JDBC
Date: Mon, 23 Jan 2006 12:02:17 -0500
Message-ID: <43D50C19.9040408@vilaj.com> (raw)
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: dba@vilaj.com
Subject: Re: Inserting an Interval Using JDBC
In-Reply-To: <43D50C19.9040408@vilaj.com>
References: <43D50C19.9040408@vilaj.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox