Value ‘0000-00-00 00:00:00’ can not be represented as java.sql.Timestamp
来源:互联网 发布:淘宝违规提醒怎么处理 编辑:程序博客网 时间:2024/05/22 09:42
这个问题很简单,只需要把数据库中“0000-00-00 00:00:00”的数据改为可用的时间即可。
但是,由于是公司的数据库,个人不可以随便修改,即满足查询条件的数据,即使时间为“0000-00-00 00:00:00”,也要查出来,修改方法如下:添加zeroDateTimeBehavior=convertToNull即可。
JDBC_URL = jdbc:mysql://localhost:3306/test?characterEncoding=utf-8&autoReconnect=true&&zeroDateTimeBehavior=convertToNull
另附:timestamp和datetime的区别:
datetime支持的范围是'1000-01-01 00:00:00'到'9999-12-31 23:59:59';timestamp支持的范围是 1970-2037年
阅读全文
0 0
- Err:java.sql.SQLException: Value '0000-00-00' can not be represented as java.sql.Timestamp
- [DEBUG] “java.sql.SQLException: Value '0000-00-00' can not be represented as java.sql.Timestamp”
- java.sql.SQLException: Value '0000-00-00' can not be represented as java.sql.Timestamp
- “java.sql.SQLException: Value '0000-00-00' can not be represented as java.sql.Timestamp”
- java 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
- 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;
- Value ‘0000-00-00 00:00:00’ can not be represented as java.sql.Timestamp
- Value '0000-00-00' can not be represented as java.sql.Timestamp
- Value '0000-00-00' can not be represented as java.sql.Timestamp错误
- mysql Value '0000-00-00' can not be represented as java.sql.Timestamp
- mysql抛出Value '0000-00-00' can not be represented as java.sql.Timestamp异常
- hiERROR: Value '0000-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
- SSM整合第二天
- string.Format对C#字符串格式化
- SSM第三天
- bootstrap 导航条详解
- java中synchronized的用法
- Value ‘0000-00-00 00:00:00’ can not be represented as java.sql.Timestamp
- Monkey and Banana LIS
- 下载百度文库里面的PDF文档(只能下PDF文档)
- 一个注册页面的HTML实现
- python 全套教程视频 传智博客 百度网盘
- 权限管理系统。
- 对PostgreSQL 的 hash join 的原理的学习
- 手机wap前端开发经验
- 基于深度学习的CVaaS计算机视觉即服务案例(Computer Vision as a Service)