`
pengfeifei26
  • 浏览: 248287 次
  • 性别: Icon_minigender_1
  • 来自: 北京
文章分类
社区版块
存档分类
最新评论

Value '0000-00-00' can not be represented as java.sql.Timestamp

阅读更多
Value '0000-00-00' can not be represented as java.sql.Timestamp
关键字: 数据库字段为datetime类型时默认值为:0000-00-00 00:00:00
mysql
数据库字段为datetime类型时默认值为:0000-00-00 00:00:00
查询时异常
java.sql.SQLException:Value '0000-00-00' can not be represented as java.sql.Date
解决方法在url后添加 &zeroDateTimeBehavior=convertToNull
datasource.url=jdbc:mysql://localhost:3306/pe?useUnicode=true&characterEncoding=gbk&zeroDateTimeBehavior=convertToNull

注意 &->&
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics