> This question was asked back in 1999 and wasn't answered, so hopefully
> someone will answer it now.
>
> I am using JBoss and they provide a JDBC to mySQL type mapping that maps
> java.util.Dates to a jdbc-type of DATE and mySQL type of DATETIME.  Well,
> only the date portion (10-31-2001) is being stored and the time is set to
> 00:00:00.  It is a very simple question, why isn't the time being stored?
I
> am using the MM jdbc driver.  Is it the driver code?

The reason could be one of 2 possible. The type of the column,and how you
set the date..

since you say the column is of type DATETIME that is notthe problem.

If you are using prepared statements in jdbc then the problem couldbe that
you are using
the function

stmt.setDate(column, date);

try use

stmt.setTimestamp(column, date)

instead.. since setDate is for setting dates, not date AND  time :-)

other jdbc:s this might set a datetime also, but not the mm.mysql jdbc..
if this is a bugor just a stricter handlingI do not know..
but that is most likely your problem


/Christian Andersson


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to