Error getting nested result map values for ' User_inf '. Cause:java.sql.SQLException:Cannot Convert

Source: Internet
Author: User

Problem?   Error Getting nested result map values for ' User_inf '. Cause:java.sql.SQLException:Cannot convert value ' 0000-00-00 00:00:00 ' from Column 8 to TIMESTAMP.


Error: Org.apache.ibatis.exceptions.PersistenceException:
# # # Error querying database.  Cause:org.apache.ibatis.executor.ExecutorException:Error getting nested result map values for ' User_inf '. Cause:java.sql.SQLException:Cannot convert value ' 0000-00-00 00:00:00 ' from Column 8 to TIMESTAMP.
# # # The error may exist in Com/itcast/mapper/userinfmapper.xml
# # # The error may involve com.itcast.mapper.userinfmapper.finduserandinf-inline
# # # The error occurred while setting parameters
# # # Sql:select P.id,p.username,p.password,p.age,p.remark, i.id as Infid,i.inf,i.time from (select Id,username,passwor D,age,remark from user) p left join (select Id,inf,time from User_inf) i on P.id=i.id WHERE username=?
# # # Cause:org.apache.ibatis.executor.ExecutorException:Error getting nested result map values for ' User_inf '. Cause:java.sql.SQLException:Cannot convert value ' 0000-00-00 00:00:00 ' from Column 8 to TIMESTAMP.
At Org.apache.ibatis.exceptions.ExceptionFactory.wrapException (exceptionfactory.java:23)
At Org.apache.ibatis.session.defaults.DefaultSqlSession.selectList (defaultsqlsession.java:107)
At Org.apache.ibatis.session.defaults.DefaultSqlSession.selectList (defaultsqlsession.java:98)
At Com.itcast.test.UserInfTest.test1 (userinftest.java:20)
At Sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
At Sun.reflect.NativeMethodAccessorImpl.invoke (nativemethodaccessorimpl.java:57)
At Sun.reflect.DelegatingMethodAccessorImpl.invoke (delegatingmethodaccessorimpl.java:43)
At Java.lang.reflect.Method.invoke (method.java:606)
At Org.junit.runners.model.frameworkmethod$1.runreflectivecall (frameworkmethod.java:44)
At Org.junit.internal.runners.model.ReflectiveCallable.run (reflectivecallable.java:15)
At org.junit.runners.model.FrameworkMethod.invokeExplosively (frameworkmethod.java:41)
At Org.junit.internal.runners.statements.InvokeMethod.evaluate (invokemethod.java:20)
At Org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored (blockjunit4classrunner.java:79)
At Org.junit.runners.BlockJUnit4ClassRunner.runChild (blockjunit4classrunner.java:71)
At Org.junit.runners.BlockJUnit4ClassRunner.runChild (blockjunit4classrunner.java:49)
At Org.junit.runners.parentrunner$3.run (parentrunner.java:193)
At Org.junit.runners.parentrunner$1.schedule (parentrunner.java:52)
At Org.junit.runners.ParentRunner.runChildren (parentrunner.java:191)
At org.junit.runners.parentrunner.access$000 (parentrunner.java:42)
At Org.junit.runners.parentrunner$2.evaluate (parentrunner.java:184)
At Org.junit.runners.ParentRunner.run (parentrunner.java:236)
At Org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run (junit4testreference.java:50)
At Org.eclipse.jdt.internal.junit.runner.TestExecution.run (testexecution.java:38)
At Org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests (remotetestrunner.java:467)
At Org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests (remotetestrunner.java:683)
At Org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run (remotetestrunner.java:390)
At Org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main (remotetestrunner.java:197)
caused by:org.apache.ibatis.executor.ExecutorException:Error getting nested result map values for ' User_inf '. Cause:java.sql.SQLException:Cannot convert value ' 0000-00-00 00:00:00 ' from Column 8 to TIMESTAMP.
At Org.apache.ibatis.executor.resultset.NestedResultSetHandler.applyNestedResultMappings ( nestedresultsethandler.java:182)
At Org.apache.ibatis.executor.resultset.NestedResultSetHandler.getRowValue (nestedresultsethandler.java:137)
At Org.apache.ibatis.executor.resultset.NestedResultSetHandler.handleRowValues (nestedresultsethandler.java:102)
At Org.apache.ibatis.executor.resultset.FastResultSetHandler.handleResultSet (fastresultsethandler.java:188)
At Org.apache.ibatis.executor.resultset.NestedResultSetHandler.handleResultSet (nestedresultsethandler.java:73)
At Org.apache.ibatis.executor.resultset.FastResultSetHandler.handleResultSets (fastresultsethandler.java:154)
At Org.apache.ibatis.executor.statement.PreparedStatementHandler.query (preparedstatementhandler.java:57)
At Org.apache.ibatis.executor.statement.RoutingStatementHandler.query (routingstatementhandler.java:70)
At Org.apache.ibatis.executor.SimpleExecutor.doQuery (simpleexecutor.java:57)
At Org.apache.ibatis.executor.BaseExecutor.queryFromDatabase (baseexecutor.java:259)
At Org.apache.ibatis.executor.BaseExecutor.query (baseexecutor.java:132)
At Org.apache.ibatis.executor.CachingExecutor.query (cachingexecutor.java:105)
At Org.apache.ibatis.executor.CachingExecutor.query (cachingexecutor.java:81)
At Org.apache.ibatis.session.defaults.DefaultSqlSession.selectList (defaultsqlsession.java:104)
... More
caused By:java.sql.SQLException:Cannot convert value ' 0000-00-00 00:00:00 ' from Column 8 to TIMESTAMP.
At Com.mysql.jdbc.SQLError.createSQLException (sqlerror.java:1055)
At Com.mysql.jdbc.SQLError.createSQLException (sqlerror.java:956)
At Com.mysql.jdbc.SQLError.createSQLException (sqlerror.java:926)
At Com.mysql.jdbc.ResultSetRow.getTimestampFast (resultsetrow.java:1336)
At Com.mysql.jdbc.ByteArrayRow.getTimestampFast (bytearrayrow.java:126)
At Com.mysql.jdbc.ResultSetImpl.getTimestampInternal (resultsetimpl.java:6687)
At Com.mysql.jdbc.ResultSetImpl.getTimestamp (resultsetimpl.java:6006)
At Com.mysql.jdbc.ResultSetImpl.getTimestamp (resultsetimpl.java:6044)
At Sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
At Sun.reflect.NativeMethodAccessorImpl.invoke (nativemethodaccessorimpl.java:57)
At Sun.reflect.DelegatingMethodAccessorImpl.invoke (delegatingmethodaccessorimpl.java:43)
At Java.lang.reflect.Method.invoke (method.java:606)
At Org.apache.ibatis.logging.jdbc.ResultSetLogger.invoke (resultsetlogger.java:59)
At Com.sun.proxy. $Proxy 4.getTimestamp (Unknown Source)
At Org.apache.ibatis.type.DateTypeHandler.getNullableResult (datetypehandler.java:36)
At Org.apache.ibatis.type.DateTypeHandler.getNullableResult (datetypehandler.java:25)
At Org.apache.ibatis.type.BaseTypeHandler.getResult (basetypehandler.java:51)
At Org.apache.ibatis.executor.resultset.FastResultSetHandler.getPropertyMappingValue (Fastresultsethandler.java : 325)
At Org.apache.ibatis.executor.resultset.FastResultSetHandler.applyPropertyMappings (Fastresultsethandler.java : 301)
At Org.apache.ibatis.executor.resultset.NestedResultSetHandler.getRowValue (nestedresultsethandler.java:135)
At Org.apache.ibatis.executor.resultset.NestedResultSetHandler.applyNestedResultMappings ( nestedresultsethandler.java:169)
... More
caused By:java.sql.SQLException:Value ' [[email protected] ' can not be represented as Java.sql.Timestamp
At Com.mysql.jdbc.SQLError.createSQLException (sqlerror.java:1055)
At Com.mysql.jdbc.SQLError.createSQLException (sqlerror.java:956)
At Com.mysql.jdbc.SQLError.createSQLException (sqlerror.java:926)
At Com.mysql.jdbc.ResultSetRow.getTimestampFast (resultsetrow.java:1034)
... More


The reason for this is that the column names in the database tables are in the timestamp format (to time format ), and the date in Java cannot be converted to each other .



Error getting nested result map values for ' User_inf '. Cause:java.sql.SQLException:Cannot Convert

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.