Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id CF5649F9F49 for ; Wed, 13 Dec 2006 00:05:13 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-new, port 10024) with ESMTP id 89434-08 for ; Wed, 13 Dec 2006 00:05:09 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 Received: from web60525.mail.yahoo.com (web60525.mail.yahoo.com [209.73.178.173]) by postgresql.org (Postfix) with SMTP id 07F8B9F9ED7 for ; Wed, 13 Dec 2006 00:05:08 -0400 (AST) Received: (qmail 69601 invoked by uid 60001); 13 Dec 2006 04:05:08 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID; b=P3O4ji+uzl0Wd4qhMQYxxnDiixKaIhpNfaWyRpTLut/NY7wHZ8OyxzuSCkHfCMPe5B7oAqdrN2HgugC4Ehl+LVQsrBV+zG2AEwMvYnYec3/3K5xxcOUuHVzgReJh3saW1hnTaccVuan+L3UX/vZ72Q7yS71+yYtxge/O+OQtvSQ=; X-YMail-OSG: jmtxRGMVM1k4Aw0Zat22s5m1uZFWWdkovh7DMmAMMIYrwZ30aI6g_Vj5SiuO6rcBj12B5dGSgXGcS7eD_p2o.A2SNNxTrBA2J8t1w.Jc1VQleEHHK77oGbc0rjtrFLdmd0g.jclRT5qRKJV2T.OuriCqc2VYW8k4eYSYaAxqGeHAW73grMGI2xlpaA-- Received: from [64.236.208.25] by web60525.mail.yahoo.com via HTTP; Tue, 12 Dec 2006 20:05:07 PST Date: Tue, 12 Dec 2006 20:05:07 -0800 (PST) From: Ravi Periasamy Subject: Re: issues with Statement.getTimestamp(int, Calendar) To: Oliver Jowett Cc: pgsql-jdbc@postgresql.org, Ravi Periasamy In-Reply-To: <457F4C61.1090902@opencloud.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Message-ID: <129657.69439.qm@web60525.mail.yahoo.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200612/60 X-Sequence-Number: 16292 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 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