Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 21064 invoked from network); 8 Nov 2007 08:05:36 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 8 Nov 2007 08:05:36 -0000 Received: (qmail 97625 invoked by uid 500); 8 Nov 2007 08:05:22 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 97116 invoked by uid 500); 8 Nov 2007 08:05:21 -0000 Mailing-List: contact user-java-help@ibatis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user-java@ibatis.apache.org Delivered-To: mailing list user-java@ibatis.apache.org Received: (qmail 96596 invoked by uid 99); 8 Nov 2007 08:05:21 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Nov 2007 00:05:20 -0800 X-ASF-Spam-Status: No, hits=-6.0 required=10.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_HI,SPF_PASS,UNPARSEABLE_RELAY X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [160.83.65.199] (HELO imr6.us.db.com) (160.83.65.199) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Nov 2007 08:05:20 +0000 Received: from msgr0003.de.db.com by imr6.us.db.com id lA87w2bm007473; Thu, 8 Nov 2007 03:04:58 -0500 (EST) In-Reply-To: <1776587413.20071107163444@gmail.com> To: user-java@ibatis.apache.org Subject: Re: Oracle date type mapping issue MIME-Version: 1.0 X-Mailer: Lotus Notes Release 6.5.5 CCH1 March 07, 2006 From: Thorsten Elfert Message-ID: Date: Thu, 8 Nov 2007 09:04:16 +0100 X-MIMETrack: Serialize by Router on MSGR0003/srv/dbsmtp(Release 6.5.5FP2 HF430|July 06, 2007) at 08.11.2007 09:04:58, Serialize complete at 08.11.2007 09:04:58 Content-Type: multipart/alternative; boundary="=_alternative 002C56BDC125738D_=" X-Virus-Checked: Checked by ClamAV on apache.org This is a multipart message in MIME format. --=_alternative 002C56BDC125738D_= Content-Type: text/plain; charset="utf-8" content-transfer-encoding: quoted-printable well, this does not work as well. I tried: and I tried: the time gets truncated all the time. Thorsten ________________________________________ Gwyn Evans =20 07.11.2007 17:34 Please respond to user-java@ibatis.apache.org To Thorsten Elfert/OuB/Zentrale/DeuBa@dbcom cc user-java@ibatis.apache.org Subject Re: Oracle date type mapping issue Hi Thorsten, On 07 November 2007, 3:58:47 PM, Thorsten Elfert wrote: > Hi,=20 I use Oracle 9i, JDK 5 and the latest iBatis Release. Whenever I read a=20 date object out of oracle and map it into a java.util.Date attribute the=20 time gets truncated. I tried already to set explicitly the javaType as=20 java.util.Date or java.sql.Timestamp and the jdbcType as DATE in the=20 sql-map but it does not solve the problem. What is the correct way to map=20 a java.util.Date to the Oracle Date Object ? (In the database the date and= =20 time gets stored correctly)=20 Try using the jdbcType as TIMESTAMP as the SQL DATE type only contains a=20 date! See "Dates and Times" here -=20 http://www.oreilly.com/catalog/jentnut2/chapter/ch02.html. --=20 /Gwyn --=20 Informationen (einschlie=C3=9Flich Pflichtangaben) zu einzelnen, innerhalb = der EU t=C3=A4tigen Gesellschaften und Zweigniederlassungen des Konzerns De= utsche Bank finden Sie unter http://www.db.com/de/content/pflichtangaben.ht= m. Diese E-Mail enth=C3=A4lt vertrauliche und/ oder rechtlich gesch=C3=BCtz= te Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Ma= il irrt=C3=BCmlich erhalten haben, informieren Sie bitte sofort den Absende= r und vernichten Sie diese E-Mail. Das unerlaubte Kopieren sowie die unbefu= gte Weitergabe dieser E-Mail ist nicht gestattet. Please refer to http://www.db.com/en/content/eu_disclosures.htm for informa= tion (including mandatory corporate particulars) on selected Deutsche Bank = branches and group companies registered or incorporated in the European Uni= on. This e-mail may contain confidential and/or privileged information. If = you are not the intended recipient (or have received this e-mail in error) = please notify the sender immediately and delete this e-mail. Any unauthoriz= ed copying, disclosure or distribution of the material in this e-mail is st= rictly forbidden. --=_alternative 002C56BDC125738D_= Content-Type: text/html; charset="utf-8" content-transfer-encoding: quoted-printable
well, this does not work as well. I tried:

<result property<= font size=3D2 face=3D"Courier New">=3D"validFrom" column=3D"VALID_FROM" jdbcType<= font size=3D2 face=3D"Courier New">=3D"TIMESTAMP"/>

and I tried:

<result property<= font size=3D2 face=3D"Courier New">=3D"validFrom" column=3D"VALID_FROM" jdbcType<= font size=3D2 face=3D"Courier New">=3D"TIMESTAMP" javaType<= font size=3D2 face=3D"Courier New">=3D"java.sql.Timestamp"/>

the time gets trunc= ated all the time.

Thorsten
____________________________________= ____


Gwyn Evans <gwyn.e= vans@gmail.com>

07.11.2007 17:34
Please respond to
user-java@ibatis.apache.org

To
Thorsten Elfert/OuB/Zentrale/DeuBa@d= bcom
cc
user-java@ibatis.apache.org
Subject
Re: Oracle date type mapping issue





Hi Thorsten,

On 07 November 2007, 3:58:47 PM, Thors= ten Elfert wrote:
= >
Hi,

I use Oracle 9i, JDK 5 and the latest iB= atis Release. Whenever I read a date object out of oracle and map it into a java.util.Date attribute the time gets truncated. I tried already to set explicitly the javaType as java.util.Date or java.sql.Timestamp and the jdbcType as DATE in the sql-map but it does not solve the problem. What is the correct way to map a java.util.Date to the Oracle Date Object ? (In the database the date and time gets stored correctly)


Try using the jdbcType as TIMESTAMP as the SQL DATE type only contains a date!
See "Dates and Times" here - = http://www.oreilly.com/cat= alog/jentnut2/chapter/ch02.html.

--
/Gwyn

--

Informationen (einschlie=C3=9Flich Pflichtangaben) zu einz= elnen, innerhalb der EU t=C3=A4tigen Gesellschaften und Zweigniederlassunge= n des Konzerns Deutsche Bank finden Sie unter ht= tp://www.db.com/de/content/pflichtangaben.htm. = Diese E-Mail enth=C3=A4lt vertrauliche und/ oder rechtlich gesch=C3=BCtzte = Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail = irrt=C3=BCmlich erhalten haben, informieren Sie bitte sofort den Absender u= nd vernichten Sie diese E-Mail. Das unerlaubte Kopieren sowie die unbefugte= Weitergabe dieser E-Mail ist nicht gestattet.

Please refer to http://www.db.c= om/en/content/eu_disclosures.htm for informatio= n (including mandatory corporate particulars) on selected Deutsche Bank bra= nches and group companies registered or incorporated in the European Union.= This e-mail may contain confidential and/or privileged information. If you= are not the intended recipient (or have received this e-mail in error) ple= ase notify the sender immediately and delete this e-mail. Any unauthorized = copying, disclosure or distribution of the material in this e-mail is stric= tly forbidden. --=_alternative 002C56BDC125738D_=--