Well I feel a little crazy. But this is what I see. I have a timestamp without time zone column with a default value of current_timestamp. In PSQL I can see this value yields a UTC value. But when I insert from JDBC (not setting that column) and then look at the value with PSQL I see a PDT value?! That is my JVM zone. When I get back to the office on Monday I'll try to create a test case.
Robert,
The driver certainly doesn't do anything to a statement like
insert into foo (datecol) values (now())
it does use the calendar of the vm to get the string representation.
Time, and date are two things not very well handled in java or JDBC. What is the exact column type and what does it store in the database
But to answer your question you can do:
stmt.setTimestamp(1, t, Calendar.getInstance( TimeZone.getTimeZone("UTC")))