krummas / DrizzleJDBC

A BSD licensed JDBC driver for Drizzle and MySQL
BSD 3-Clause "New" or "Revised" License
31 stars 22 forks source link

MySQL DateTime converted to java.sql.Date class #15

Open jterrill opened 11 years ago

jterrill commented 11 years ago

I am testing the Drizzle driver with a MySQL server and noticed a difference in behavior regarding DateTime types. I am using the jdbc:mysql:thin: scheme in this case.

It looks like the MySQLType class maps the DATETIME type into a java.sql.Date class rather than a java.sql.TimeStamp I would expect. While both of these extend java.util.Date it appears the sql Date class drops the time data which makes the data incorrect / unusable.

Is there a known way to work around this when using the driver so that I get either a complete (with time) java.util.Date or java.sql.TimeStamp for datetime fields?

Thanks in advance, Jody