Cannot convert value '0000-00-00 00:00:00' from column 19 to TIMESTAMP.

### Error querying database.  Cause: java.sql.SQLException: Cannot convert value '0000-00-00 00:00:00' from column 19 to TIMESTAMP.
### The error may involve com.dajie.core.user.dao.UserDao.getByUid-Inline
### The error occurred while setting parameters
### Cause: java.sql.SQLException: Cannot convert value '0000-00-00 00:00:00' from column 19 to TIMESTAMP.

 

解决方法:修改数据库链接的参数

jdbc:mysql://192.168.1.10:3336/DB_XXX?zeroDateTimeBehavior=convertToNull&autoCommit=true&autoReconnect=true&useUnicode=true&tinyInt1isBit=false&characterEncoding=UTF-8&yearIsDateType=false

 

注意:

zeroDateTimeBehavior=convertToNull 参数最好放到第一位,放在后面可能会失效。

你可能感兴趣的:(DAO,sql,mysql,jdbc)