Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 53921 invoked from network); 9 Jul 2010 17:44:15 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 9 Jul 2010 17:44:15 -0000 Received: (qmail 94825 invoked by uid 500); 9 Jul 2010 17:44:15 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 94782 invoked by uid 500); 9 Jul 2010 17:44:15 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 94770 invoked by uid 99); 9 Jul 2010 17:44:15 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 09 Jul 2010 17:44:15 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 09 Jul 2010 17:44:12 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id o69HhoZ1006127 for ; Fri, 9 Jul 2010 17:43:50 GMT Message-ID: <29836766.287551278697430204.JavaMail.jira@thor> Date: Fri, 9 Jul 2010 13:43:50 -0400 (EDT) From: "Mamta A. Satoor (JIRA)" To: derby-dev@db.apache.org Subject: [jira] Resolved: (DERBY-4621) Invalid conversion from Timestamp to String when calling setTimestamp() with Calendar In-Reply-To: <22389510.87711271770490197.JavaMail.jira@thor> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/DERBY-4621?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Mamta A. Satoor resolved DERBY-4621. ------------------------------------ Resolution: Fixed Backport to 10.5 done > Invalid conversion from Timestamp to String when calling setTimestamp() with Calendar > ------------------------------------------------------------------------------------- > > Key: DERBY-4621 > URL: https://issues.apache.org/jira/browse/DERBY-4621 > Project: Derby > Issue Type: Bug > Components: SQL > Affects Versions: 10.5.3.0 > Reporter: Knut Anders Hatlen > Assignee: Knut Anders Hatlen > Fix For: 10.5.3.1, 10.6.1.0 > > Attachments: derby-4621.diff, TimestampToVarchar.java > > > If you set a VARCHAR parameter with setTimestamp(), the string will be formatted differently depending on whether a Calendar is specified or not, even if the default calendar is used. > Take for example this statement: > VALUES CAST(? AS VARCHAR(30)) > I executed this statement twice with the same Timestamp instance. First like this: > ps.setTimestamp(1, ts); > and then like this > ps.setTimestamp(1, ts, Calendar.getInstance()); > In this example, both of the methods should use the default Calendar to convert the timestamp to a string. However, I see that they generate different strings: > 2010-04-20 15:17:36.0 vs 2010-04-20 03:17:36 > Note there are two differences: > 1) The method that takes a Calendar object does not show the fraction part (.0) > 2) The method that takes a Calendar object is 12 hours off (03 instead of 15) -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.