Re: [JDBC] Timestamps without time zone
Óôéò 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
---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?
http://www.postgresql.org/docs/faq
Received on Wed Jan 9 08:01:08 2008
This archive was generated by hypermail 2.1.8
: Wed Jun 18 2008 - 23:42:26 EDT
|