setString and timestamps

From: David Goodenough <david(dot)goodenough(at)btconnect(dot)com>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: setString and timestamps
Date: 2006-02-17 16:07:17
Message-ID: 200602171607.18071.david.goodenough@btconnect.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

I understand from looking at the archive that there some changes around
8.0 in this area, but I am confused as to how to proceed.

I have some code which takes a table and inserts values into it where the
values have come from XML and are thus all strings. Some of these XML
fields are timestamps, but this generic code does not have table specific
knowledge.

From what I have read I think I have to use something like the metadata
for this table to find the type of this column, and if it is a timestamp then
I need to take the string and convert it into a timestamp before I set it
into the parameterized insert. Is this right, and are there any other
datatypes which are not implicitly converted from String to whatever is
necessary?

If it is only timestamps, why are they singled out for this special treatment?

Also there was some question about the difference between timestamps
with and without zone, mine are without should that make a difference.

Is there a HOWTO about this somewhere?

David

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Tom Lane 2006-02-17 16:36:24 7.4 JDBC driver with 8.1 server?
Previous Message Scot P. Floess 2006-02-17 16:02:55 unsubscribe