| From: | Ravi Periasamy <ravitx12(at)yahoo(dot)com> |
|---|---|
| To: | Oliver Jowett <oliver(at)opencloud(dot)com> |
| Cc: | pgsql-jdbc(at)postgresql(dot)org, Ravi Periasamy <ravitx12(at)yahoo(dot)com> |
| Subject: | Re: issues with Statement.getTimestamp(int, Calendar) |
| Date: | 2006-12-13 04:05:07 |
| Message-ID: | 129657.69439.qm@web60525.mail.yahoo.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-jdbc |
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(at)opencloud(dot)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
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Dave Cramer | 2006-12-13 11:38:09 | Re: issues with Statement.getTimestamp(int, Calendar) |
| Previous Message | Oliver Jowett | 2006-12-13 00:42:09 | Re: issues with Statement.getTimestamp(int, Calendar) |