java.sql.SQLException: Value '0000-00-00 00:00:00' can not be represented as java.sql.Timestamp
2017-11-23 15:44
435 查看
异常分析:
在使用MySql时,如果数据库中有字段类型是timestamp的,且如果我们不为它赋值的话,默认为‘0000-00-00’。
但在这种状况下查询数据库是会发生异常的:java.sql.SQLException: Value '0000-00-00 ' can not be represented as java.sql.Timestamp
解决办法:
给类型为timestamp的字段赋值即可。
在使用MySql时,如果数据库中有字段类型是timestamp的,且如果我们不为它赋值的话,默认为‘0000-00-00’。
但在这种状况下查询数据库是会发生异常的:java.sql.SQLException: Value '0000-00-00 ' can not be represented as java.sql.Timestamp
解决办法:
给类型为timestamp的字段赋值即可。
相关文章推荐
- java.sql.SQLException: Value '0000-00-00 00:00:00' can not be represented as java.sql.Timestamp
- Cash Loan(二):SQLException: Value '0000-00-00 00:00:00' can not be represented as java.sql.Timestamp
- Value '0000-00-00 00:00:00' can not be represented as java.sql.Timestamp
- mysql解决Value ‘0000-00-00 00:00:00’ can not be represented as java.sql.Timestamp
- MySQL关于Value '0000-00-00 00:00:00' can not be represented as java.sql.Timestamp
- 异常java.sql.SQLException: Value '0000-00-00 00:00:00' can not be represented as java.sql.Timestamp
- java.sql.SQLException:Value '0000-00-00 00:00:00' can not be represented as java.sql.Timestamp错误解决
- SQLException: Value '0000-00-00 00:00:00' can not be represented as java.sql.Timestamp
- Value '0000-00-00 00:00:00' can not be represented as java.sql.Timestamp
- MySQL 关于 Value '0000-00-00 00:00:00' can not be represented as java.sql.Timestamp 的错误
- 开发问题:error: Value '0000-00-00 00:00:00' can not be represented as java.sql.Timestamp
- ERROR: Value '0000-00-00 00:00:00' can not be represented as java.sql.Timestamp
- Value '0000-00-00 00:00:00' can not be represented as java.sql.Timestamp报错
- 提示Value '0000-00-00 00:00:00' can not be represented as java.sql.Timestamp;
- Bug3: Value '0000-00-00 00:00:00' can not be represented as java.sql.Timestamp 时间戳错误 时间戳不能被体现
- java.sql.SQLException: Value ‘0000-00-00 00:00:00’ can not be represented as java.sql.Timestamp
- 插入Mysql异常之Value '0000-00-00 00:00:00' can not be represented as java.sql.Timestamp
- 错误:Value '0000-00-00 00:00:00' can not be represented as java.sql.Timestamp;的解决
- MySQL关于Value '0000-00-00 00:00:00' can not be represented as java.sql.Timestamp
- 关于SQLException:Value'0000-00-00 00:00:00'can not be represented as java.sql.Timestamp的问题