Re: Timestamps without time zone - Mailing list pgsql-jdbc

From Achilleas Mantzios
Subject Re: Timestamps without time zone
Date
Msg-id 200801091456.29468.achill@matrix.gatewaynet.com
Whole thread Raw
In response to Re: Timestamps without time zone  (Oliver Jowett <oliver@opencloud.com>)
Responses Re: Timestamps without time zone
List pgsql-jdbc
Στις Wednesday 09 January 2008 14:43:25 ο/η Oliver Jowett έγραψε:
> Achilleas Mantzios wrote:
> > Now instead of the above i tried something that should be "more" correct
> > and according to specs
> >     Calendar cal = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
> >     st = con.prepareStatement("select
> >         utcts,latid,longi,tracktrue,avgspeed,minspeed,maxspeed from
> > gpscookeddata where vslid=? and utcts<? and utcts>=? order by utcts");
> >     st.setInt(1,Integer.parseInt(vslid));
> >     st.setTimestamp(2,new java.sql.Timestamp(gendDate.getTime()),cal);
> >     st.setTimestamp(3,new java.sql.Timestamp(gstartDate.getTime()),cal);
> > however again i see that the JDBC insists producing code like:
> >     select utcts,latid,longi,tracktrue,avgspeed,minspeed,maxspeed from
> >     gpscookeddata where vslid=92 and utcts<'2006-03-26 07:00:00.000000+03'
> > and utcts>='2006-03-26 05:00:00.000000+03' order by utcts
>
> This is unexpected - as you say the driver should generate timestamp
> values in UTC if you pass a UTC calendar to setTimestamp.
>
> Which driver version are you using?
Its the 7.4.19 built from source.
> How are you concluding that the JDBC driver is sending +03 values?
by the postgresql log, after setting log_statement = true
>
> The driver will not generate a query string like you quoted above as it
> uses parameter placeholders (assuming you are using protocol version 3
> anyway) and sends the values out of line, which is why I'm asking.
>
> -O

--
Achilleas Mantzios

pgsql-jdbc by date:

Previous
From: Oliver Jowett
Date:
Subject: Re: Timestamps without time zone
Next
From: Oliver Jowett
Date:
Subject: Re: Timestamps without time zone