RE: Problem with Date/Time-part

From: Fredrik Liden (flide..ranslate.com)
Date: Thu Feb 24 2005 - 15:22:45 EST

  • Next message: Fredrik Liden: "Mysql -> Date/Time & tracking creation/modification time"

    Hey guys,

    Prior to Oracle 9.2 Oracles DATE type is mapped to java.util.Timestamp.
    I'm guessing if you use Cayenne-modeller DATE then the Oracle's JDBC driver will convert this to java.sql.Date. The java.sql.Date doesn't contain the time information and therefore that part is lost, which would explain why you have 00:00:00.

    To handle Date and time you'll need to use java.util.Timestamp and map it to Oracle Date or Timestamp. For Mysql this is not a problem because Mysql's Date doesn't contain time.

    Fredrik

    -----Original Message-----
    From: "René Kulschewski" [mailto:KU..vu.de]
    Sent: Thursday, February 24, 2005 6:45 AM
    To: cayenne-use..bjectstyle.org
    Subject: AW: Problem with Date/Time-part

    Hi,

    No, it does not work :-(. Any idea how to find the problem ?

    Thanks and best regards
    René

    > -----Ursprüngliche Nachricht-----
    > Von: Andrus Adamchik [mailto:andru..bjectstyle.org]
    > Gesendet: Donnerstag, 24. Februar 2005 15:17
    > An: René Kulschewski
    > Betreff: Re: Problem with Date/Time-part
    >
    > René,
    >
    > Just change DATE to TIMESTAMP for DbEntity - this should fix
    > it. Hope this helps.
    >
    > Andrus
    >
    >
    > > Hello,
    > >
    > > I have a table in Oracle with column of type "Date". In
    > this column is
    > > a value with Date+Time (checked that with SQLplus).
    > > In Cayenne-modeler this column is DATE (DbEntity) and
    > java.util.Date
    > > (ObjEntity). But when i fetch this value with Cayenne and
    > assign it to
    > > another variable i get only the "Date"-part, time is "00:00:00".
    > >
    > > Do you have any idea what's wrong ?
    > >
    > > Thanks,
    > > René
    > >
    > > Dipl.-Ing. René Kulschewski
    > > IVU Traffic Technologies AG
    > > Bundesallee 88, 12161 Berlin
    > > Telefon: +49.30.85906-0, Telefax: +49.30.85906-360
    > > mailto:Rene.Kulschewsk..vu.de, http://www.ivu.de
    >
    >
    >
    >



    This archive was generated by hypermail 2.0.0 : Thu Feb 24 2005 - 15:22:20 EST