Re: Timestamps without time zone

From: Achilleas Mantzios <achill(at)matrix(dot)gatewaynet(dot)com>
To: Oliver Jowett <oliver(at)opencloud(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Timestamps without time zone
Date: 2008-01-09 12:56:29
Message-ID: 200801091456.29468.achill@matrix.gatewaynet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Oliver Jowett 2008-01-09 13:05:24 Re: Timestamps without time zone
Previous Message Oliver Jowett 2008-01-09 12:43:25 Re: Timestamps without time zone