最近在项目中使用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. ing

    #include <stdio.h> int main(){ int a,b; while(scanf("%d%d",&a,&b)!=EOF & ...

  2. require.js学习笔记(内容属于转载总结)

    <script data-main="src/app" src="src/lib/require.js"></script> backb ...

  3. 《Java程序设计》实验四 实验报告

    实验四 Android开发基础 实验内容 XP基础 XP核心实践 相关工具 实验要求 1.没有Linux基础的同学建议先学习<Linux基础入门(新版)><Vim编辑器> 课程 ...

  4. cf------(round 2)A. Winner

    A. Winner time limit per test 1 second memory limit per test 64 megabytes input standard input outpu ...

  5. Anagrams [LeetCode]

    Given an array of strings, return all groups of strings that are anagrams. Note: All inputs will be ...

  6. SQL Server 自定义函数(1)把某一列多行的值拼接成一个字符串

    ) SET @resultstr='' SELECT @resultstr=@resultstr+'|'+[BaseImage] FROM dbo.life_fc PRINT @resultstr 示 ...

  7. WordPress怎么在页面上添加目录

    要实现的如下功能,在页面上添加一个文章目录: 步骤:   1)在wordpress中,在Posts----Categories中建立目录, 2) 3)add new post,指定post所属的cat ...

  8. 开发excel 自定义func

    http://www.cnblogs.com/brooks-dotnet/archive/2011/01/16/1936871.html http://club.excelhome.net/threa ...

  9. Tomcat6.0总是运行不了 总是出现Unable to open the service 'Tomcat6'

    如果配置没有问题的话,如果你是win7系统,在开始菜单运行Tomcat,运行提示"Unable to open the service ‘tomcat6’"的话,应该是win7的安 ...

  10. 关于HTML5应用开发功耗调优化小结

    HTML5的优化一直是困扰我的难题,特别是在移动端开发游戏和应用,所以对此进行了一些总结: 功耗优化点介绍 在移动设备中主要的功耗点在: 1. 网络的传输, 不管是3G网络还是WiFi传输都是移动设备 ...