错误: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;刚开始以为是代码中格式化结果集中的日期报错,找了一遍发现并没有对日期进行格式化,发现是查询的结果集中某数据行的日期值为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;的解决的更多相关文章
- 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 ...
- '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,默认为 ...
- 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 ...
- 报错 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 ...
- Value '0000-00-00 00:00:00' can not be represented as java.sql.Timestamp
1.问题场景描述:后台方法中执行查询返回list列表中,执行后台产生运行时异常 java.sql.SQLException: 2.问题排查和解决:排查代码,无编译时错误,断点调试,更具控制台找到对应的 ...
- 解决 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 页面中,时间字段类型为空的信息显示不出来,且报错信息如下: ...
随机推荐
- nginx负载均衡之基于客户端cookie的会话保持
通过ip_hash做会话保持有一定的缺陷,这个是通过客户端ip来实现.同一个网络下众多客户端访问服务器会被扔到同一台机器,再或者是CDN也 会导致负载不均衡.所以要实现通过客户端cookie实现,包括 ...
- Oracle 存储过程学习
转自:http://blog.chinaunix.net/uid-20495387-id-174394.html http://www.cnblogs.com/rootq/articles/11000 ...
- Android 实用开源控件
图片放大缩小: PinchImageView 体验最好的图片手势控件,不同分辨率无缝切换,可与ViewPager结合使用. GestureViews 带有手势控制的ImageView和FrameLay ...
- [题解+总结]NOIP2013-2014提高组题目浅析
1.前言 迎接NOIP的到来...在这段闲暇时间,决定刷刷水题.这里只是作非常简单的一些总结. 2.NOIP2014 <1> 生活大爆炸之石头剪刀布(模拟) 这是一道考你会不会编程的题目. ...
- Linux下bash: scp: command not found问题 或者装ssh包时报错 Requires: libedit.so.0()(64bit)
一.用scp命令从物理主机向CentOS 6.1虚拟机传送文件,提示以下错误:bash: scp: command not found到CentOS 6.1虚拟机查看也缺少scp命令.该虚拟机 ...
- jQuery学习笔记(一):入门【转】
由于工作的需要,发现JQuery是一个绕不开的东西,现在开始学习. 一.JQuery是什么 JQuery是什么?始终是萦绕在我心中的一个问题: 借鉴网上同学们的总结,可以从以下几个方面观察. 不使用J ...
- 使用diff制作补丁
1.制作补丁包 命令格式 diff -uNr oldfile.c newfile.c > x.patch 2.打补丁 命令格式 patch -p0 < x.patch 总结一下:单个文件 ...
- as3如何做出残影效果
在页游中,时不时能看到人物做一些快速移动动作如冲刺时,有残影效果,强化了画面表现.实际人肉眼之所以能看到残影的效果,是因为观察到的物体会在人视线中残留几十毫秒时间,当运动物体运动太快时,人肉眼所见未能 ...
- [CareerCup] 17.13 BiNode 双向节点
17.13 Consider a simple node-like data structure called BiNode, which has pointers to two other node ...
- [zt]OpenCV2.1.0的安装
下载和安装 OpenCV 2.1.0 2.添加库文件:打开VS 2008,选择菜单:Tools->options->Projects and Solutions >VC++ Dire ...