好久没记录了,最近一直在忙着工作以及码前后端 记录下这种大多数人都会碰到但是又不一定找得到问题的错误

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的更多相关文章

  1. 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 ...

  2. 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 ...

  3. 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 ...

  4. 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 ...

  5. 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 ...

  6. SqlMapClient operation; bad SQL grammar []; nested exception is com.ibatis.common.jdbc.exception.NestedSQLException: InlineParameterMap

    <select id="getResByName" resultClass="Resources" parameterClass="java.l ...

  7. 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 ...

  8. 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 ...

  9. 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 ...

  10. 启动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 ...

随机推荐

  1. .NET中委托性能的演变

    .NET中的委托 .NET中的委托是一项重要功能,可以实现间接方法调用和函数式编程. 自.NET Framework 1.0起,委托在.NET中就支持多播(multicast)功能.通过多播,我们可以 ...

  2. ChatGPT 何许人也

    有时候会想,如果chatGPT是人,它会是一个怎样的人呢?下面是我的推测过程. 首先,她应该是女人 会推测而不会计算 你问它: 3457 * 43216 = ,它回答 149261912 (这是错的. ...

  3. IDEA配置JDK版本的地方, 适用于Compilation failed: internal java compiler error

    错误原因: 1. 编译版本不匹配 2.当前项目jdk版本不支持 解决方法 查看项目的jdk 查看工程的jdk 查看java编译器版本 讲这些改成自己需要的版本, 一般就可以解决编译版本出现的错误

  4. 30张图说清楚 TCP 协议

    大家好,我是风筝 前两天分享了 20张图说清楚 IP 协议 今天,继续来网管的自我修养之TCP协议,这可是除 IP 协议外另一个核心协议了. TCP 协议是网络传输中至关重要的一个协议,它位于传输层. ...

  5. R语言文本挖掘细胞词库的转换

    搜狗细胞词库解析 一. 加载R包转换 library(rJava) library(Rwordseg) write.csv(as.data.frame(importSogouScel('wuliu.s ...

  6. Oracle宕机之PMON (ospid: 248987): terminating the instance due to error 484(另附hugepage配置方法)

    数据库版本:11.2.0.4 RAC环境 操作系统版本:Asianux Server release 7.3 数据库报错分析 接到业务消息,应用无法访问,开发人员查看日志后发现无法连接数据库. 查看数 ...

  7. 【CTF】系统调用号查询表

    32位 #ifndef _ASM_X86_UNISTD_32_H #define _ASM_X86_UNISTD_32_H 1 #define __NR_restart_syscall 0 #defi ...

  8. linux 给lvm磁盘扩容

    目录 linux 给lvm磁盘扩容 扩容步骤 确认可用空间 创建新的物理卷 将物理卷添加到现有的卷组中 扩展逻辑卷 linux 给lvm磁盘扩容 早上到公司发现磁盘满了,挂载点是一个lvm 跟领导确认 ...

  9. day07-OpenFeign-服务调用

    SpringCloud OpenFeign-服务调用 1.OpenFeign介绍 https://github.com/spring-cloud/spring-cloud-openfeign Open ...

  10. day32:进程&进程join&守护进程deamon

    目录 1.进程的基本概念 2.进程初体验 3.join:先子后主 4.守护进程:deamon 5.使用自定义类的方式创建进程 6.两张和进程相关的图 进程的基本概念 什么是进程? 进程就是正在运行的程 ...