pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Vinayak <vinpokale@gmail.com>
To: pgsql-jdbc@postgresql.org
Subject: Re: Problem with DATE
Date: Wed, 7 Jan 2015 00:01:08 -0700 (MST)
Message-ID: <1420614068412-5833152.post@n5.nabble.com> (raw)
In-Reply-To: <CA+xsaB3ovLRj_75j4hyMC+rB+JbV9vVYUgRvnm4+KcOr5-e8KQ@mail.gmail.com>
References: <1420546864196-5833008.post@n5.nabble.com>
	<CA+xsaB3ovLRj_75j4hyMC+rB+JbV9vVYUgRvnm4+KcOr5-e8KQ@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-jdbc>

I tried to connect PostgreSQL using the version 2 protocol.
but the result showing the timezone part.
example:
2014-01-11 +05:30:00
 
PostgreSQL has TIMESTAMP and TIMESTAMPTZ type but in JAVA there is only
setTimestamp() and if we use protocolVersion "2" then the result showing the
time zone value.

Example:
For timestamp(without timezone):
java.sql.Timestamp  sqlDate = new java.sql.Timestamp(new
java.util.Date().getTime());
ps.setTimestamp(5, sqlDate);
Result:
2015-01-07 12:18:03.150000 +05:30:00

So I think instead of using protocolVersion "2" its better to typecast the
argument.



-----
Regards,
Vinayak,

--
View this message in context: http://postgresql.nabble.com/Problem-with-DATE-tp5833008p5833152.html
Sent from the PostgreSQL - jdbc mailing list archive at Nabble.com.


-- 
Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc



view thread (20+ messages)  latest in thread

Message-ID: <1420614068412-5833152.post@n5.nabble.com>
Permalink:  ../1420614068412-5833152.post@n5.nabble.com/
Also on:    postgresql.org/message-id/1420614068412-5833152.post@n5.nabble.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: vinpokale@gmail.com
  Subject: Re: Problem with DATE
  In-Reply-To: <1420614068412-5833152.post@n5.nabble.com>
  References: <1420546864196-5833008.post@n5.nabble.com> <CA+xsaB3ovLRj_75j4hyMC+rB+JbV9vVYUgRvnm4+KcOr5-e8KQ@mail.gmail.com> <1420614068412-5833152.post@n5.nabble.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox