Here's the bits needed to get "now" into a
JDBC date-time field:
No need to mess around with formatting timestamps as Strings. Also, if your column type is DATETIME then you need setTimestamp(); setDate() will only set the date part of the column. (The designers of
Java were not quite at the top of their game when they used "Date" as the name of a class to encapsulate date
and time information, so generations of beginners have been confused.)