title: Springboot + MySQL: cannot read any date type from (DATE, DATETIME, TIMESTAMP) MySQL
body: <p>I am using Springboot and MYSQL. My app can write date type (java.util.Date, java.sql.Timestamp) into mysql with type (DATE, DATETIME, TIMESTAMP). However, no matter what date type I used in Java and MySQL, Spring just cannot read the date from MySQL.Does anyone has any clue of how to solve the problem? Thanks a lot in advance.
  1) it works for other data types, INT, TEXT, VARCHAR etc. everything works fine.
  2) I checked the date stored in MYSQL, they are all in the right format.
  3) The date type combination I tried are:</p>
  
  <pre><code>java.sql.Date with mysql:DATETIME
  java.sql.Date with mysql:DATE
  java.util.Date with mysql:DATETIME
  java.util.Date with mysql:DATE
  java.sql.Timestamp mysql:TIMESTAMP
  </code></pre>
  
  <p>They are all the same, I can successfully write into mysql, but cannot read the date information from the database.</p>
  
  <p>My properties file:</p>
  
  <pre><code>spring.datasource.url=jdbc:mysql://127.0.0.1:3306/forum_demo
  ?useUnicode=true&amp;characterEncoding=utf8
  spring.datasource.username=root
  spring.datasource.password=****
  mybatis.config-location=classpath:mybatis-config.xml
  spring.datasource.driver-class-name=com.mysql.jdbc.Driver
  </code></pre>
  
  <p>My Model:</p>
  
  <pre><code>public class Comment {
  
  private int id;
  private String content;
  private int userId;
  /* I tried java.util.Date here as well for DATETIME in MYSQL, it is the same result*/
  private Timestamp createDate;
  private int entityId;
  private int entityType;
  private int status;
  ...
  }
  </code></pre>
  
  <p>Everytime I debug my application, the getter of createDate always return a "null".</p>