最近在项目中使用hibernate查询时,总报错“java.sql.SQLException: Value '0000-00-00' can not be represented as java.sql.Timestamp”,但是直接在Navicat Premium中运行sql可以正常得到值,无任何错误,后来仔细分析下日志信息,发现返回的数据中含有字段值为0000-00-00 00:00:00,而在hibernate将结果映射成实体时,会认为此种格式不是正确的java.sql.Timestamp,固会报错,以后要多加小心为好

“java.sql.SQLException: Value '0000-00-00' can not be represented as java.sql.Timestamp”的更多相关文章

  1. 【异常】update更新java.sql.SQLException: Duplicate entry '2019-07-30 00:00:00-110100' for key

    1 详细异常信息 User class threw exception: java.sql.SQLException: Duplicate entry '2019-07-30 00:00:00-110 ...

  2. java.sql.SQLException: ORA-00911: invalid character 解决方法

    java.sql.SQLException: ORA-00911: invalid character 控制台抛出这个异常:java.sql.SQLException: ORA-00911: inva ...

  3. Oracle java.sql.SQLException: 数字溢出

    六月 30, 2016 5:47:47 下午 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinit ...

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

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

  5. java.sql.SQLException: Access denied for user 'scott'@'localhost' (using password: YES)

    今天用eclipse连接一下数据库,出现此异常. java.sql.SQLException: Access denied for user 'scott'@'localhost' (using pa ...

  6. org.springframework.jdbc.UncategorizedSQLException: Error attempting to get column 'alarmGroup' from result set. Cause: java.sql.SQLException: Error

    异常展示: org.springframework.jdbc.UncategorizedSQLException: Error attempting to get column 'alarmGroup ...

  7. 解决sqoop导入报错:Caused by: java.sql.SQLException: Protocol violation

    报错信息: -- ::, INFO [main] org.apache.hadoop.mapred.MapTask: Ignoring exception during close for org.a ...

  8. java jdbc->mycat->oracle SqlException异常中文信息乱码解决

    mycat字符集gbk oracle字符集gbk 原jdbc连接串: base.jdbc.url=jdbc:mysql://127.0.0.1:3306/XXX?useUnicode=true& ...

  9. Mysql-提示java.sql.SQLException: Cannot convert value '0000-00-00 00:00:00' from column 7 to TIMESTAMP.

    在Mysql数据库中使用DATETIME类型来存储时间,使用JDBC中读取这个字段的时候,应该使用 ResultSet.getTimestamp(),这样会得到一个java.sql.Timestamp ...

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

随机推荐

  1. C++编译错误cannot have cv-qualifier

    C++编译错误cannot have cv-qualifier 在C++中CV指const和volatile两个关键字.有两种情况不能使用CV限定. 一.非成员函数不能含有CV限定,即const和vo ...

  2. DI 之 3.4 Bean的作用域(捌)

    3.4  Bean的作用域 什么是作用域呢?即"scope",在面向对象程序设计中一般指对象或变量之间的可见范围.而在Spring容器中是指其创建的Bean对象相对于其他Bean对 ...

  3. css清除默认样式和设置公共样式

    /*公共样式--开始*/ html, body, div, ul, li, h1, h2, h3, h4, h5, h6, p, dl, dt, dd, ol, form, input, textar ...

  4. 正确理解Spring AOP中的Around advice

    Spring AOP中,有Before advice和After advice,这两个advice从字面上就可以很容易理解,但是Around advice就有点麻烦了. 乍一看好像是Before ad ...

  5. Scrum项目3.0

    1. 确保product backlog井然有序.(参考示例图1) 2. Sprint周期,一个冲刺周期,长度定为两周,本学期还有三个冲刺周期. 3. 确定Sprint目标. 3.1 产品负责人概括产 ...

  6. js正则标志/g /i /m的用法,以及实例

    js正则标志/g /i /m的用法,以及实例   正则的思想都是一样的,但是具体的写法会有所不同,在这里提到的/g,/i,/m在其他的地方也许就不能用了. 一,js正则标志/g,/i,/m说明 1,/ ...

  7. java基础学习之 消息对话款

    package Dome; import java.awt.event.*; import java.awt.*; import javax.swing.*; public class WindowM ...

  8. VS2010中将当前选定项目做为启动项

    Visual Studio 2010一个解决方案中多个项目,如果想选择哪个项目就设置哪个项目为启动项可以这么做. 一.对于以后新建的解决方案想这样通过VS设置工具: 二.对于已经存在的解决方案可以这样 ...

  9. 串口调试,提示the given port name does not start with COM/com异常解决办法,,发现是打印机在搞怪

    串口测试时,用到串口,把打印机的拔下来,换上测试的,程序一打开就提示错误:the given port name does not start with COM/com or does not res ...

  10. BootStrap 最佳资源合集(转)

    witter BootStrap是一款优秀的前端的框架,称得上是前端的一个框架利器.Web前端开发者每天都在与HTML.CSS.JavaScript打交道,然 而不少人都是在周而复始的写模板.样式和交 ...