Re: DATETIME with mysql

From: Dirk Olmes (dirk.olme..mx.de)
Date: Wed Sep 03 2003 - 02:30:27 EDT

  • Next message: Mario Linke: "JNDI InitialContext"

    > I assume MySQL DATETIME includes both date and time information(?) In this
    > case, mapping DbAttribute to TIMESTAMP should work just fine. On the Java
    > side you may use java.util.Date (or java.sql.Timestamp, though I
    > personally prefer Date)

    You're right, DATETIME includes both date and time. This is the type you
    definitely want to use when storing custom date and time info in the database
    since MySQL's TIMESTAMP datetype is defined differently from other DBMSs:

    > The TIMESTAMP column type provides a type that you can use to
    automatically mark INSERT or
    > UPDATE operations with the current date and time. If you have multiple
    TIMESTAMP columns, only the
    > first one is updated automatically.

    See http://www.mysql.com/doc/en/DATETIME.html for more info on MySQL's
    TIMESTAMP.

    Oh well, yet another MySQL inconsistency ...

    -dirk

    -- 
    COMPUTERBILD 15/03: Premium-e-mail-Dienste im Test
    --------------------------------------------------
    1. GMX TopMail - Platz 1 und Testsieger!
    2. GMX ProMail - Platz 2 und Preis-Qualitätssieger!
    3. Arcor - 4. web.de - 5. T-Online - 6. freenet.de - 7. daybyday - 8. e-Post
    



    This archive was generated by hypermail 2.0.0 : Wed Sep 03 2003 - 02:29:09 EDT