使用MyBatis框架时发现的一些小bug


在大配置MyBatis.xml中:  不能有空节点属性 ,否则启动服务器后点击登录没有反应。

 

异常问题:

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

解决办法:

HTTP Status 500 - Request processing failed; nested exception is org.springframework.dao.TransientDataAccessResourceException: Error attempting to get column 'coupon_end_time' from result set. Cause: java.sql.SQLException: Value '0000-00-00 00:00:00' can not be represented as java.sql.Timestamp

    问题:页面展示信息是报错,因为数据库中某时间戳的列值为0000-00-00 00:00:00,所有报错

    原因:因为我时间戳的默认值为,0000-00-00 00:00:00,我删除了默认之就好了

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM