Re: [JDBC] Re: Re: [JDBC] Timestamp parameter gets sent as date - Mailing list pgsql-jdbc

From Vladimir Sitnikov
Subject Re: [JDBC] Re: Re: [JDBC] Timestamp parameter gets sent as date
Date
Msg-id CAB=Je-HY1wjA2LhzGm3P9+E0-o7Q1YGWb+5+a=wY0NQa6zWAeQ@mail.gmail.com
Whole thread Raw
In response to [JDBC] Re: Re: [JDBC] Timestamp parameter gets sent as date  (Genya <genyap@online.ua>)
List pgsql-jdbc
Genya>SOMETIMES shows parameters used GMT 

It might be related with "user.timezone" Java property.

I would either recommend using Java 8's java.time API (it has notion for timestamp+timezone) or use setTimestamp(.., Timestamp, Calendar).
There's PGTimestamp, however it is not much better than java.time.

In case of "setTimestamp(3, Timestamp)" the value that is sent to the DB depends on the Java's default time zone.

Would you please check that?

Vladimir

pgsql-jdbc by date:

Previous
From: Genya
Date:
Subject: [JDBC] Re: Re: [JDBC] Timestamp parameter gets sent as date
Next
From: Genya
Date:
Subject: [JDBC] Re: [JDBC] Timestamp parameter gets sent as date