Home>

MySQL doesn't store Date type dates.

Error message

I want to store the registration date in MySQL with the Date type, but I am in trouble.
The issue flag (0 → 1) updated together can be registered in the DB.
Processing other than this date registration is going through.

Is it a format issue?

Applicable source code

Column name: Date
Type: Date
Format: yyyy-mm-dd

// Manager class
for (int i = 0;i<DateList.size ();i ++) {
DateList.get (i) .setOutputFlg ("1");
DateList.get (i) .setDate (DateList.get (i) .getDate ());
}
<Dao class>.update (DateList);
// DAO class
Session session = sessionFactory.getCurrentSession ();
For (int i = 0;i<DateList.size ();i ++) {
Session.update (DateList.get (i));
}
session.flush ();


The contents to overwrite the DB are as follows.
Issue flag OutputFlg (CHAR type)
Registration date Date (Date type)

I tried to check the format conversion, but I couldn't solve it.

Supplemental information (FW/tool version etc.)

Java7
MySQL
Spring