What\'s the simplest way to convert a java.sql.Date object to a java.util.Date while retaining the timestamp?
I tried:
java.util.Date newDate = new D
From reading the source code, if a java.sql.Date
does actually have time information, calling getTime()
will return a value that includes the time information.
If that is not working, then the information is not in the java.sql.Date
object. I expect that the JDBC drivers or the database is (in effect) zeroing the time component ... or the information wasn't there in the first place.
I think you should be using java.sql.Timestamp
and the corresponding resultset methods, and the corresponding SQL type.