解决报错:java.sql.SQLException: Value ‘0000-00-00 00:00:00‘ can not be represented as java.sql.Timestamp

解决方法:

  • 在数据库的连接配置文件druid.properties中加入zeroDateTimeBehavior=convertToNull
  • 加入前:url=jdbc:mysql://localhost:3306/e?
  • 加入后:url=jdbc:mysql://localhost:3306/e?zeroDateTimeBehavior=convertToNull
    简单有效,完美解决

猜你喜欢

转载自blog.csdn.net/weixin_44809329/article/details/109697692