标签:
MySQL 表存在两个字段类型是TIMESTAMP 的时候,经常出现问题如下:
Caused by: java.sql.SQLException: Value ‘0000-00-00 00:00:00‘ can not be represented as java.sql.Timestamp
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1078)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:989)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:975)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:920)
at com.mysql.jdbc.ResultSetRow.getTimestampFast(ResultSetRow.java:1102)
解决方法是: zeroDateTimeBehavior=convertToNull
类似:#MySQL
hibernate.dialect=org.hibernate.dialect.MySQLDialect
validationQuery.sqlserver=SELECT 1
jdbc.url.jeecg=jdbc:mysql://127.0.0.1:3306/jeewx?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull
标签:
原文地址:http://blog.csdn.net/likunwen_001/article/details/44943395