Re: Re: Re: [JDBC] Timestamp parameter gets sent as date

From: Vladimir Sitnikov <sitnikov(dot)vladimir(at)gmail(dot)com>
To: Genya <genyap(at)online(dot)ua>
Cc: "\"List\"" <pgsql-jdbc(at)postgresql(dot)org>, "\"Dave Cramer\"" <pg(at)fastcrypt(dot)com>
Subject: Re: Re: Re: [JDBC] Timestamp parameter gets sent as date
Date: 2017-09-22 17:45:37
Message-ID: CAB=Je-HY1wjA2LhzGm3P9+E0-o7Q1YGWb+5+a=wY0NQa6zWAeQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

>

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Genya 2017-09-25 07:20:07 Re: [JDBC] Timestamp parameter gets sent as date
Previous Message Genya 2017-09-22 15:55:04 Re: Re: [JDBC] Timestamp parameter gets sent as date