Value '0000-00-00 00:00:00' can not be represented as java.sql.Timestamp; nested exception is java.sql.SQLException: Value '0000-00-00 00:00:00' can not be represented as java.sql.Timestamp
好久没记录了,最近一直在忙着工作以及码前后端 记录下这种大多数人都会碰到但是又不一定找得到问题的错误
1 Value '0000-00-00 00:00:00' can not be represented as java.sql.Timestamp; nested exception is java.sql.SQLException: Value '0000-00-00 00:00:00' can not be represented as java.sql.Timestamp

一般是数据库表设计字段为DateTime类型时数据库默认给了0000-00-00这种默认值,在数据库看来是合法合理的,但是在jvm中并不认可
因此,做法无非就是让他输出的默认值变为 null 或者 有正确的默认值输出
解决方法也很简单:在数据库链接后加上 &zeroDateTimeBehavior=convertToNull 这样输出默认值为null 就不会报错了

Value '0000-00-00 00:00:00' can not be represented as java.sql.Timestamp; nested exception is java.sql.SQLException: Value '0000-00-00 00:00:00' can not be represented as java.sql.Timestamp的更多相关文章
- Mybatis笔记四:nested exception is org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'id' in 'class java.lang.String'
错误异常:nested exception is org.apache.ibatis.reflection.ReflectionException: There is no getter for pr ...
- org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'socialCode' in 'class java.lang.String'
异常: org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.reflection.Refl ...
- nested exception is org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'enterpriseId' in 'class java.lang.String'
错误信息: nested exception is org.apache.ibatis.reflection.ReflectionException: There is no getter for p ...
- JSON parse error: default constructor not found. class java.time.YearMonth; nested exception is com.alibaba.fastjson.JSONException: default constructor not found. class java.time.YearMonth
java8新出的YearMonth可以方便的用来表示某个月.我的项目中使用springmvc来接收YearMonth类型的数据时发现 x-www-from-urlencoded 格式的数据可以使用&q ...
- bad SQL grammar []; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException
### Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL ...
- SqlMapClient operation; bad SQL grammar []; nested exception is com.ibatis.common.jdbc.exception.NestedSQLException: InlineParameterMap
<select id="getResByName" resultClass="Resources" parameterClass="java.l ...
- nested exception is java.sql.SQLException: Cannot convert value '0000-00-00 00:00:00' from column 14 to TIMESTAMP.
无法将"0000-00-00 00:00:00"转换为TIMESTAMP 2017-05-08 00:56:59 [ERROR] - cn.kee.core.dao.impl.Ge ...
- Failed to convert from type [java.lang.String] to type [java.util.Date] for value '2020-02-06'; nested exception is java.lang.IllegalArgumentException]解决
今天做springbook项目前端输入日期传到数据库保存报了一下错误 Whitelabel Error Page This application has no explicit mapping fo ...
- Spring 整合 Flex (BlazeDS)无法从as对象 到 Java对象转换的异常:org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'java.util.Date' to required type 'java.sql.Timestamp' for property 'wfsj'; nested exception is java.lang.Ill
异常信息如下: org.springframework.beans.ConversionNotSupportedException: Failed to convert property value ...
- 启动Spring boot报错:nested exception is java.sql.SQLException: Field 'id' doesn't have a default value
先看具体日志: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with n ...
随机推荐
- [转]常见的视频编码详解 Cinepak Codec by Radius
AVI所采用的压缩算法并无统一的标准.也就是说,同样是以AVI为后缀的视频文件,其采用的压缩算法可能不同,需要相应的解压软件才能识别和回放该AVI文件.除了Microsoft公司之外,其他公司也推出了 ...
- IDEA如何使用Maven不通过模板创建javaWeb项目
IDEA如何使用Maven不通过模板创建javaWeb项目 1.创建项目 进入IDEA,点击"项目">"新建项目",填写项目信息,最后点击"创建 ...
- 分布式CAP_BASE博客参考
https://blog.csdn.net/lixinkuan328/article/details/95535691 CAP 一致性(Consistency) 可用性(Availability) 分 ...
- 《程序员的自我修养》学习笔记——ELF 文件结构介绍【第二弹】
ELF 文件结构介绍 文件头 以 ELF 文件64位版本为例: e_ident [ELF魔数 16byte] 1-4字节:ELF 文件都必须相同的标识码,分别为 0x7F,0x45,0x4C,0x46 ...
- MasaFramework入门第二篇,安装MasaFramework了解各个模板
安装MasaFramework模板 执行以下命令安装最新Masa的模板 dotnet new --install Masa.Template 安装完成将出现四个模板 Masa Blazor App: ...
- Linux理论知识
Linux理论知识 理论知识 1.1文件名后缀 1 作用是说明和注释一个文件的性质. 2 与文件类型无关. 1.2常见的压缩文件后缀名 1.gz 2.bz2 3.xz 4.zip 5.tar 6. ...
- Oracle宕机之PMON (ospid: 248987): terminating the instance due to error 484(另附hugepage配置方法)
数据库版本:11.2.0.4 RAC环境 操作系统版本:Asianux Server release 7.3 数据库报错分析 接到业务消息,应用无法访问,开发人员查看日志后发现无法连接数据库. 查看数 ...
- 利用 kubeadm 创建 kubernetes (k8s) 的高可用集群
引言: kubeadm提供了两种不同的高可用方案. 堆叠方案:etcd服务和控制平面被部署在同样的节点中,对基础设施的要求较低,对故障的应对能力也较低 堆叠方案 最小三个Master(也称工作平面), ...
- Redis 数据类型 Set
Redis 数据类型 Set(集合) Redis 常用命令,思维导图 >>> Redis 的 Set 是 String 类型的无序集合.集合成员是唯一的,这就意味着集合中不能出现重复 ...
- 【数据结构与算法】无向图的结构与遍历 BFS&DFS
1 表示无向图的数据类型 1.1 邻接矩阵 可以使用一个V*V的二维布尔矩阵,当定点v和定点w相连的时候,定义第v行第w列的值为true,否则为false.邻接矩阵不适合定点较多的情况,含有百万的顶点 ...