Value '0000-00-00 00:00:00' can not be represented as java.sql.Timestamp
1、问题场景描述:后台方法中执行查询返回list列表中,执行后台产生运行时异常 java.sql.SQLException:
2、问题排查和解决:排查代码,无编译时错误,断点调试,更具控制台找到对应的报错地方:

断点调试发现,就是数据库交互时返回值接收时候发生异常:

代码没有问题,排查数据库,因为是时间戳的错误:

找相关时间的字段,发现存在单个对象的属性值其对应的数据库字段类型为date或者datetime类型但是值为0的情况,如0000-00-00:

将相关字段改为正常的时间点值,再次执行,问题解决。
Value '0000-00-00 00:00:00' can not be represented as java.sql.Timestamp的更多相关文章
- '0000-00-00 00:00:00' can not be represented as java.sql.Timestamp error
		'0000-00-00 00:00:00' can not be represented as java.sql.Timestamp error 异常现象 ### Cause: java.sql.SQ ... 
- 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,默认为 ... 
- 错误: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
		下面是我查询数据库时打印出来的异常信息: ### Error querying database. Cause: java.sql.SQLException: Value '0000-00-00 0 ... 
- Caused by: java.sql.SQLException: Value '0000-00-00 00:00:00' can not be represented as java.sql.Timestamp
		错误信息如下: Caused by: java.sql.SQLException: Value '0000-00-00 00:00:00' can not be represented as java ... 
- 报错 java.sql.SQLException: Value '0000-00-00 00:00:00' can not be represented as java.sql.Timestamp 原因
		sql异常 java.sql.SQLException: Value '0000-00-00 00:00:00' can not be represented as java.sql.Timestam ... 
- 解决 SQLException: Value '0000-00-00 00:00:00' can not be represented as java.sql.Timestamp的问题
		连接数据库时 设置:zeroDateTimeBehavior=convertToNull 
- 报错:java.sql.SQLException: Value '0000-00-00 00:00:00' can not be represented as java.sql.Timestamp
		感谢原文作者:风起云淡- 原文链接:https://blog.csdn.net/shenguan777/article/details/78615521 异常分析: 在使用MySql时,如果数据库中有 ... 
- java.sql.SQLException: Value '0000-00-00 00:00:00' can not be represented as java.sql.Date
		架构使用jsp+servlet+java+mysql mysql里time字段类型为datetime java实体类中该字段类型为Date 页面中,时间字段类型为空的信息显示不出来,且报错信息如下: ... 
随机推荐
- Matlab中导入文本文件中的数据 矩阵合并 以及C++中删除文件操作
			今天用到了Matlab读取文本文件中按照一定格式存储好的数据,然后进行后续的分析计算等,因此涉及到Matlab的文件读取,记录在这里,供以后查阅: fid = fopen('train.set', ' ... 
- 前端 HTML 常用标签 head标签相关内容 link标签
			link标签 引入CSS样式文件 href="./index.css" CSS文件的路径 <!-- 引入CSS样式文件 --> <link rel="s ... 
- ERROR 1153 (08S01): Got a packet bigger than 'max_allowed_packet' bytes怎么处理
			今天ytkah进行了应急数据库恢复,用Navicat for Mysql导入sql文件出现ERROR 1153 (08S01): Got a packet bigger than 'max_allow ... 
- vue-watch监听路由的变化
- Learn nodejs:   Tutorials for Programmers of All Levels,    程序员每个阶段的示例
			https://stackify.com/learn-nodejs-tutorials/ What is Node.js? Node.js can be defined as a dynamic, c ... 
- Windows PyCharm永久激活
			1.下载 链接: https://pan.baidu.com/s/1LvQozk5lXdyk2p8qgGsr3A 提取码: x1t5 放置到 pycharm安装目录的\bin目录下(位置可随意,只要配 ... 
- [LeetCode] 35. Search Insert Position_Easy tag: Binary Search
			Given a sorted array and a target value, return the index if the target is found. If not, return the ... 
- trie字典树
			---恢复内容开始--- 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1251 #include <bits/stdc++.h> usin ... 
- Linux df命令详解
			1.命令:df 2.命令功能:显示指定磁盘文件的可用空间. 3.命令参数: -a #全部文件系统列表 -h #方便阅读方式显示 -H #等于“-h”,但是计算式,1K=1000,而不是1K=1024 ... 
- 利用TensorFlow实现多元线性回归
			利用TensorFlow实现多元线性回归,代码如下: # -*- coding:utf-8 -*- import tensorflow as tf import numpy as np from sk ... 
