[J resolved]: When the time java.util.Date objects directly into the area Mysql error

1. Description of the problem

mysql table field data type is datetime, the entity class attribute field corresponding to the data type java.util.Date

 

In doing insertion operation, if a direct assignment java.util.Date object database to the new data will be less eight hours,

 

 

 

 

 2, the solution

2.1 Entity Type String class attribute field to

 

 2.2 Formatting java.util.Date object class SimpleDateFormat formatted into a string of time, data is normally inserted.

Guess you like

Origin www.cnblogs.com/jsonfa/p/12091835.html