pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ravi Periasamy <ravitx12@yahoo.com>
To: Oliver Jowett <oliver@opencloud.com>
Cc: pgsql-jdbc@postgresql.org
Cc: Ravi Periasamy <ravitx12@yahoo.com>
Subject: Re: issues with Statement.getTimestamp(int, Calendar)
Date: Tue, 12 Dec 2006 20:05:07 -0800 (PST)
Message-ID: <129657.69439.qm@web60525.mail.yahoo.com> (raw)
In-Reply-To: <457F4C61.1090902@opencloud.com>

The test case is as follows.

I created a function as follows:
==================================================
create or replace function testouttimestamp(OUT a1
timestamp) AS $$
begin
  a1 := '1970-01-01 00:00:00';
end;
$$ language plpgsql;
==================================================

and called through JDBC as follows:
==================================================
TimeZone tz = TimeZone.getTimeZone("GMT");
Calendar cr = Calendar.getInstance(tz);
CallableStatement stmt = con.prepareCall( "{call
testouttimestamp(?)}");
stmt.registerOutParameter(1, Types.TIMESTAMP);
stmt.execute();
Timestamp ts = stmt.getTimestamp(1, cr);
System.out.println("ts = " + ts);
==================================================

Actual Result ==> 
1969-12-31 18:30:00.0

Expected Result ==> 
1970-01-01 05:30:00.0

Note: ResultSet.getTimestamp(int, Calendar) works
fine.

Thanks
Ravi

--- Oliver Jowett <oliver@opencloud.com> wrote:

> Ravi Periasamy wrote:
> > Dear PSQL-JDBC team,
> > 
> > There is a issue with Statement.getTimestamp(int,
> > Calendar). The timestamp is offset in the wrong
> > direction.
> > 
> > The quivalent on ResultSet.getTimestamp(int,
> Calendar)
> > works fine.
> > 
> > Is this a known bug, can we expect a fix for this,
> > when?
> 
> Can you send a testcase demonstrating the problem
> please?
> 
> -O
> 



 
____________________________________________________________________________________
Want to start your own business?
Learn how on Yahoo! Small Business.
http://smallbusiness.yahoo.com/r-index



view thread (10+ messages)  latest in thread

Message-ID: <129657.69439.qm@web60525.mail.yahoo.com>
Permalink:  ../129657.69439.qm@web60525.mail.yahoo.com/
Also on:    postgresql.org/message-id/129657.69439.qm@web60525.mail.yahoo.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: ravitx12@yahoo.com, oliver@opencloud.com
  Subject: Re: issues with Statement.getTimestamp(int, Calendar)
  In-Reply-To: <129657.69439.qm@web60525.mail.yahoo.com>
  References: <457F4C61.1090902@opencloud.com> <129657.69439.qm@web60525.mail.yahoo.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