mabatis查询数据库错误Error attempting to get column 'birthday' from result set

org.apache.ibatis.exceptions.PersistenceException: 
### Error querying database.  Cause: org.apache.ibatis.executor.result.ResultMapException: Error attempting to get column 'birthday' from result set.  Cause: java.sql.SQLException: Value '0000-00-00' can not be represented as java.sql.Date
### The error may exist in com/xxx/mapper/UserMapper.xml
### The error may involve com.xxx.mapper.UserMapper.queryUserById
### The error occurred while handling results
### SQL: select id,username,sex,birthday,address from user where id=?
### Cause: org.apache.ibatis.executor.result.ResultMapException: Error attempting to get column 'birthday' from result set.  Cause: java.sql.SQLException: Value '0000-00-00' can not be represented as java.sql.Date

org.apache.ibatis.exceptions.PersistenceException:
查询数据库出错。原因:org.apache.ibatis.executor.result。ResultMapException:试图从结果集中获取列’birthday’时出错。原因:java.sql。SQLException:值“00:00 -00-00”不能表示为java.sql.Date
错误可能存在于com/xxx/mapper/UserMapper.xml中
错误可能涉及com.xxx.mapper.UserMapper.queryUserById
处理结果时发生错误
SQL:从id=的用户处选择id、用户名、性别、生日、地址?
原因:org.apache.ibatis.executor.result。ResultMapException:试图从结果集中获取列’birthday’时出错。原因:java.sql。SQLException:值“00:00 -00-00”不能表示为java.sql.Date

错误原因是数据库中有一个日期的值是0000-00-00 时间不能全为零 修改了就好了

你可能感兴趣的:(踩坑记录)