spring.datasource.url配置改下增加zeroDateTimeBehavior=convertToNull
如下
hibernate 查询mysq的datetime的值为null或者0000-00-00 00:00:00 报错

server.port=9004
spring.application.name=ihrm-system #指定服务名
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.datasource.url=jdbc:mysql://localhost:3306/ihrm?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull
spring.datasource.username=root
spring.datasource.password=123456
spring.jpa.database=mysql
spring.jpa.show-sql=true
spring.jpa.open-in-view=true

相关文章:

  • 2022-12-23
  • 2021-11-19
  • 2022-12-23
  • 2021-10-08
  • 2021-11-10
  • 2021-05-17
猜你喜欢
  • 2022-12-23
  • 2022-01-14
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-27
相关资源
相似解决方案