setString and timestamps - Mailing list pgsql-jdbc

From David Goodenough
Subject setString and timestamps
Date
Msg-id 200602171607.18071.david.goodenough@btconnect.com
Whole thread Raw
Responses Re: setString and timestamps  (Kris Jurka <books@ejurka.com>)
List 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

pgsql-jdbc by date:

Previous
From: "Scot P. Floess"
Date:
Subject: unsubscribe
Next
From: Tom Lane
Date:
Subject: 7.4 JDBC driver with 8.1 server?