问题说明

今天跑spring boot项目,在查看列表数据时后台抛异常了,一看是这玩意:

问题原因

“0000-00-00 00:00:00”在mysql中是作为一个特殊值存在的但 java.sql.Date 将其视为 不合法的值 格式不正确!

解决方案

需要在jdbc url中增加针对此种0日期数据的处理参数:将全0日期转换为null

zeroDateTimeBehavior=convertToNull  

添加后的URL:

jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull

问题处理:java.sql.SQLException: Value '0000-00-00 00:00:00' can not be represented as java.sql.Timestamp的更多相关文章

  1. java.sql.SQLException: Lock wait timeout exceeded --转

    org.springframework.dao.CannotAcquireLockException 的解决> 直接上 bug 的详细信息: 2012-03-12 15:20:31 XmlBea ...

  2. tomcat dbcp 基于jndi当配置java.sql.SQLException: Already closed

    最近发现了一个现象,观察到的生产环境,不要有一段时间操作,然后另一个操作,首先将有一个数据库连接:java.sql.SQLException: Already closed.,例如下列: error ...

  3. Error getting nested result map values for 'company'. Cause: java.sql.SQLException: Invalid value for getInt() - 'NFHK188'

    我今天遇到一个我不解的问题,是mybatis多对一关系查询出问题了,但是我自己还是解决了,在网上也查过那个错误,可是找不到我想要的.不知道你们遇到过没有,我接下来分享给大家.希望我这个第一篇博客能帮助 ...

  4. java.sql.SQLException之数组越界

    java.sql.SQLException之数组越界 1.具体错误如下: (1)java.sql.SQLException:Parameter index out of range(0<1) ( ...

  5. java.sql.SQLException: Can not issue empty query.

    1.错误描述 java.sql.SQLException: Can not issue empty query. at com.mysql.jdbc.SQLError.createSQLExcepti ...

  6. nested exception is java.sql.SQLException: IO 错误

    1.错误描述 (mx.messaging.messages::ErrorMessage)#0 body = (null) clientId = "18CE3B03-9709-9DA8-763 ...

  7. Caused by:java.sql.SQLException:ORA-00923

    1.错误描述 Caused by:java.sql.SQLException:ORA-00923:未找到要求的FROM关键字 2.错误原因 拼接SQL语句时缺少FROM什么表,导致出错 3.解决办法 ...

  8. java.sql.SQLException: Parameter index out of range (3 > number of parameters, which is 2).

    java.sql.SQLException: Parameter index out of range (3 > number of parameters, which is 2). java. ...

  9. JavaWeb:c3p0配置问题-----java.sql.SQLException: Connections could not be acquired from the underlying database!

    错误原因 c3p0的配置错误 错误显示 -classpath "D:\Program\Software\IntelliJIDEA\IntelliJ IDEA 2018.2.5\lib\ide ...

  10. Spring_错误 java.sql.SQLException: Lock wait timeout exceeded | CannotAcquireLockException 的解决

    java.sql.SQLException: Lock wait timeout exceeded |  org.springframework.dao.CannotAcquireLockExcept ...

随机推荐

  1. [转帖]查看mysql分区名和各分区数据量

    – 查看mysql分区名和各分区数据量 SELECT table_name, partition_name, table_rows FROM information_schema.PARTITIONS ...

  2. [转帖]使用s3(minio)为kubernetes提供pv存储

    http://www.lishuai.fun/2021/12/31/k8s-pv-s3/#/%E8%A6%81%E6%B1%82 我们可以通过csi使用s3为kubernetes提供pv存储,当我们申 ...

  3. [转帖]坑:jmeter代理服务器录制脚本出现target controller is configured to "use recording Controller" but no such controller exists...

    配置好代理服务器后,运行代理服务器 run 报错: target controller is configured to "use recording Controller" bu ...

  4. [转帖]12.JVM运行时数据区之虚拟机栈概述

    https://blog.csdn.net/u011069294/article/details/107050001 目录 1. 内存中的栈与堆 2.栈的优点 1. 内存中的栈与堆 栈是运行时单位,堆 ...

  5. [转帖]-O1,-O2,-O3编译优化知多少

    1.从.c文件到可执行文件,其间经历了几步? 高级语言是偏向人,按照人的思维方式设计的,机器对这些可是莫名奇妙,不知所谓.那从高级语言是如何过渡到机器语言的呢?这可是一个漫长的旅途呀! 其中,得经历这 ...

  6. [转帖]简单理解Linux的Memory Overcommit

    https://zhuanlan.zhihu.com/p/551677956 Memory Overcommit的意思是操作系统承诺给进程的内存大小超过了实际可用的内存.一个保守的操作系统不会允许me ...

  7. [转帖][译]ARM大小核架构白皮书

    https://zhuanlan.zhihu.com/p/33411449 ARM big.LITTLE Processing with ARM Cortex-A15 & Cortex-A7 ...

  8. [转帖]使用 Crash 工具分析 Linux dump 文件

    前言 Linux 内核(以下简称内核)是一个不与特定进程相关的功能集合,内核的代码很难轻易的在调试器中执行和跟踪.开发者认为,内核如果发生了错误,就不应该继续运行.因此内核发生错误时,它的行为通常被设 ...

  9. Oracle DBCA 静默删除以及建库的脚本

    No.1 背景 公司最近有一个测试环境需要重新备份恢复 但是里面有6个数据库实例 400多G的数据文件. 一般情况下 需要drop user xxx cascade ; 然后执行 drop table ...

  10. 【MySQL】InnoDB vs MyISAM

      MySQL默认数据库引擎 事务支持 索引类型 索引数据结构 对锁的支持 使用场景 关于count(*) 外键支持 InnoDB 5.1版本后,是 默认为Read committed 聚集索引,叶子 ...