Caused by: java.sql.SQLException: Value '0000-00-00 00:00:00' can not be represented as java.sql.Timestamp

错误信息如下:

Caused by: java.sql.SQLException: Value ‘0000-00-00 00:00:00‘ can not be represented as java.sql.Timestamp

原因如下:
是因为数据表中字段类型与对象中的属性类型不一致。比如在我的数据表中是datetime类型,正常来说,对象中应该是Date类型,但是本次在对象中却是String类型。

解决办法:
(1)将datetime类型修改为varchar类型,即可解决问题;
(2)将Java对象属性类型(对应的那个)改为Date类型(java.util而非java.sql),即可解决问题;

Caused by: java.sql.SQLException: Value '0000-00-00 00:00:00' can not be represented as java.sql.Timestamp

原文地址:https://www.cnblogs.com/youcong/p/10667047.html

时间: 2024-08-04 20:47:23

Caused by: java.sql.SQLException: Value '0000-00-00 00:00:00' can not be represented as java.sql.Timestamp的相关文章

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

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

Cause: java.sql.SQLException: 无法转换为内部表示(Mybatis)

公司开发档案系统使用框架:Spring+Struts2+Mybatis+EasyUI,在开发过程中出现sql异常:“Cause: java.sql.SQLException: 无法转换为内部表示”,错误如下: org.springframework.jdbc.UncategorizedSQLException: ### Error querying database. Cause: java.sql.SQLException: 无法转换为内部表示 ### The error may involv

java.sql.SQLException: Connections could not be acquired from the underlying database!

警告: [email protected]72 -- Acquisition Attempt Failed!!! Clearing pending acquires. While trying to acquire a needed new resource, we failed to succeed more than the maximum number of allowed acquisition attempts (30).java.sql.SQLException: Connectio

Could not open JDBC Connection for transaction; nested exception is java.sql.SQLException: Connectio

严重: StandardWrapper.Throwableorg.springframework.transaction.CannotCreateTransactionException: Could not open JDBC Connection for transaction; nested exception is java.sql.SQLException: Connections could not be acquired from the underlying database!

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

1.错误叙述性说明 java.sql.SQLException: Can not issue empty query. at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:996) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:935) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:

java.sql.SQLException: ORA-00911: 无效字符

今天写一个查询SQL的时候,出现了"java.sql.SQLException: ORA-00911: 无效字符"的问题,各种百度问题找答案,说是SQL语句中多了不该有的符号.我的是多了分号,因为SQL语句在PL/SQL中试过没问题,就直接复制粘贴过来用了,结果,底层SQL语句不能有分号 错误代码如下: 然后控制台就报了如下错误: 把红色方框里面的分号去掉,然后就没有错误了.哎,写代码小细节贼多.

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

org.springframework.dao.CannotAcquireLockException 的解决> 直接上 bug 的详细信息: 2012-03-12 15:20:31 XmlBeanDefinitionReader [INFO] Loading XML bean definitions from class path resource [org/springframework/jdbc/support/sql-error-codes.xml] 2012-03-12 15:20:31

java.sql.SQLException: 无效的列类型: 1111

在使用Mybaits Plus更新数据时报错: 2018-09-05 10:55:40.712 DEBUG 15828 --- [nio-8110-exec-1] c.c.x.s.m.A.updateAllColumnById : ==> Preparing: UPDATE ais0060 SET TENANT_ID=?,LIFNR=?,NAME1=?,ORT01=?,TELF1=?,del_flag=?,remarks=?,create_by=?,create_date=?,update_by

Cause: org.apache.ibatis.executor.ExecutorException: Error getting generated key or setting result to parameter object. Cause: java.sql.SQLException: 不支持的特性

mybatis插入数据时报错: Cause: org.apache.ibatis.executor.ExecutorException: Error getting generated key or setting result to parameter object. Cause: java.sql.SQLException: 不支持的特性 at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFacto