问题:

  代码中查询MySQL的结果集时报错,提示Value '0000-00-00 00:00:00' can not be represented as java.sql.Timestamp;刚开始以为是代码中格式化结果集中的日期报错,找了一遍发现并没有对日期进行格式化,发现是查询的结果集中某数据行的日期值为0000-00-00 00:00:00。因MySQL的时间类型datetime范围是1000-01-01 00:00:00 到 9999-12-31 23:59:59,所以报错。

解决方法:

  将日期改为正常日期即可。

错误:Value '0000-00-00 00:00:00' can not be represented as java.sql.Timestamp;的解决相关推荐

  1. MySQL 错误【四】Value ‘0000-00-00 00:00:00’ can not be represented as java.sql.Timestamp

    1. 错误描述 在使用mysql时,如果数据库中的字段类型是timestamp,默认为0000-00-00,会发生异常:Value '0000-00-00 00:00:00' can not be r ...

  2. MySQL错误:Value ‘0000-00-00 00:00:00‘ can not be represented as java.sql.Timestamp

    java项目,使用MySQL,字段类型为timestamp,字段值默认为0000-00-00 00:00:00. 在解析数据时会抛出一个异常: java.sql.SQLException: Value ...

  3. mysql解决Value ‘0000-00-00 00:00:00’ can not be represented as java.sql.Timestamp

    同步发布:http://www.yuanrengu.com/index.php/mysqlsolvetimestamp.html 在使用mysql时,如果数据库中的字段类型是timestamp,默认为 ...

  4. 关于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.Time ...

  5. 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 分析: ...

  6. 已解决:java.sql.SQLException: Value ‘0000-00-00 00:00:00‘ can not be represented as java.sql.Timestamp

    一.问题 一大早到公司 Mysql 中的一个 datetime 字段时碰到了一个 Cause: java.sql.SQLException: Value '0000-00-00 00:00:00' c ...

  7. Cause: java.sql.SQLExceptioValue ‘0000-00-00 00:00:00‘ can not be represented as java.sql.Timestamp

    今天使用mybatis创建demo测试的时候发现了一个有意思的bug org.apache.ibatis.exceptions.PersistenceException: ### Error quer ...

  8. Value ‘0000-00-00 00:00:00‘ can not be represented as java.sql.Timestamp

    程序使用select 语句查询数据时,出现以下异常: java.sql.SQLException:Value '0000-00-00' can not be represented as java.s ...

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

    一.问题分析 问题 Error querying database. Cause: java.sql.SQLException: Value'0000-00-00 00:00:00' can not ...

最新文章

  1. Nature:拟南芥根系微生物组的结构
  2. 这是一篇工程师对产品经理的吐槽
  3. Nginx —— nginx的命令行控制(nginx的启动与停止、重载配置文件、回滚日志文件、平滑升级等操作)
  4. spring data mongo比较两个字段查询
  5. C语言重要知识点回顾
  6. 顺序表实现栈相关操作
  7. java jvm对象_Java对象在JVM中长啥样
  8. 视频全程:哈萨比斯首次公开解读AlphaZero
  9. php中一个字符占用几个字节?
  10. Office 2007中的config.xml个性定制说明
  11. Linux目录结构及其英文全称
  12. stc单片机呼吸灯c语言,用51单片机制作呼吸灯
  13. Word产品需求文档,已经过时了
  14. 模拟器安装app 报错误 INSTALL_FAILED_NO_MATCHING_ABIS
  15. 备份谷歌或其他浏览器插件
  16. python字符串操作入门十八讲——合集一
  17. mac上设置ms office word初始窗口大小
  18. MATLAB 中出现 Undefined variable py or function py.command 错误
  19. 支付宝生活缴费商业项目标准版-赖国荣-专题视频课程
  20. Mawi DNA Technologies的样本采集产品组合获得CE认证

热门文章

  1. python35是什么意思_python -m是什么意思CentOS 升级 Python3 (附带: 一键升级脚本)...
  2. php实现小说字典功能_四十章 PHP实现获取并生成数据库字典的方法
  3. java ftl 标签_Freemarker-标签使用
  4. 中国半导体材料市场投资潜力与发展动态研究报告2022版
  5. 全球及中国航空材料行业发展动态及应用格局展望规划报告2021-2027年版
  6. RabbitMQ 最常用的三大模式
  7. 二.安全NA之ASA基础
  8. 9.优先队列,priority_queue
  9. chrome浏览器使用技巧
  10. unity3d为对象添加脚本的两种方法