想要实现的功能就是签到签退,点击签到按钮的时候,出现问题:

严重: Servlet.service() for servlet [springmvc] in context with path [/OA_web] threw exception [Request processing failed; nested exception is org.springframework.dao.DataIntegrityViolationException: 
### Error updating database.  Cause: com.mysql.jdbc.MysqlDataTruncation: Data truncation: Incorrect date value: '11:41:13' for column 'time_out' at row 2

这个问题的大致意思就是类型转换错误,我在代码中设置的是,这个时间为String类型,但是我在数据库中,这个签到时间设置的类型为Date,所以出现了无法将字符型转换为时间类型,修改数据库中时间字段类型即可

 

Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐