You have a error in your SQL syntax; Check the manual, corresponds to your MySQL server version

Source: Internet
Author: User
Tags aop

1. Error description

Org.hibernate.exception.SQLGrammarException:error executing Workat Org.hibernate.exception.internal.SQLExceptionTypeDelegate.convert (sqlexceptiontypedelegate.java:80) at Org.hibernate.exception.internal.StandardSQLExceptionConverter.convert (standardsqlexceptionconverter.java:49) At Org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert (sqlexceptionhelper.java:126) at Org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert (sqlexceptionhelper.java:112) at Org.hibernate.engine.jdbc.internal.JdbcCoordinatorImpl.coordinateWork (jdbccoordinatorimpl.java:318) at Org.hibernate.internal.SessionImpl.doWork (sessionimpl.java:2059) at Org.hibernate.internal.SessionImpl.doReturningWork (sessionimpl.java:2055) 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.springframewOrk.aop.support.AopUtils.invokeJoinpointUsingReflection (aoputils.java:317) at Org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint (Reflectivemethodinvocation.java : At Org.springframework.aop.framework.ReflectiveMethodInvocation.proceed (Reflectivemethodinvocation.java : 157) at Org.springframework.aop.framework.adapter.AfterReturningAdviceInterceptor.invoke ( afterreturningadviceinterceptor.java:52) at Org.springframework.aop.framework.ReflectiveMethodInvocation.proceed (reflectivemethodinvocation.java:179) at Org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke ( exposeinvocationinterceptor.java:92) at Org.springframework.aop.framework.ReflectiveMethodInvocation.proceed ( reflectivemethodinvocation.java:179) at Org.springframework.aop.framework.JdkDynamicAopProxy.invoke ( jdkdynamicaopproxy.java:207) at Com.sun.proxy. $Proxy 68.upBaseInfo (Unknown Source) at Org.springframework.cglib.proxy.MethodProxy.invoke (methodproxy.java:204) at Org.springframework.aop.framewoRk. Cglibaopproxy$dynamicadvisedinterceptor.intercept (cglibaopproxy.java:640) 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.springframework.web.method.support.InvocableHandlerMethod.invoke (invocablehandlermethod.java:215) at Org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest (invocablehandlermethod.java:132 ) at Org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle ( SERVLETINVOCABLEHANDLERMETHOD.JAVA:104) at Org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod ( requestmappinghandleradapter.java:749) at Org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal ( requestmappinghandleradapter.java:689) AT Org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle ( abstracthandlermethodadapter.java:83) at Org.springframework.web.servlet.DispatcherServlet.doDispatch ( dispatcherservlet.java:938) at Org.springframework.web.servlet.DispatcherServlet.doService ( dispatcherservlet.java:870) at Org.springframework.web.servlet.FrameworkServlet.processRequest ( frameworkservlet.java:961) at Org.springframework.web.servlet.FrameworkServlet.doPost (frameworkservlet.java:863) At Javax.servlet.http.HttpServlet.service (httpservlet.java:646) at Org.springframework.web.servlet.FrameworkServlet.service (frameworkservlet.java:837) at Javax.servlet.http.HttpServlet.service (httpservlet.java:727) at Org.apache.catalina.core.ApplicationFilterChain.internalDoFilter (applicationfilterchain.java:303) at Org.apache.catalina.core.ApplicationFilterChain.doFilter (applicationfilterchain.java:208) at Org.apache.tomcat.websocket.server.WsFilter.doFilter (wsfilter.java:52) at Org.apache.catalina.core.ApplicationFilterCHain.internaldofilter (applicationfilterchain.java:241) at Org.apache.catalina.core.ApplicationFilterChain.doFilter (applicationfilterchain.java:208) at Org.apache.catalina.core.ApplicationFilterChain.internalDoFilter (applicationfilterchain.java:241) at Org.apache.catalina.core.ApplicationFilterChain.doFilter (applicationfilterchain.java:208) at Org.apache.catalina.core.ApplicationFilterChain.internalDoFilter (applicationfilterchain.java:241) at Org.apache.catalina.core.ApplicationFilterChain.doFilter (applicationfilterchain.java:208) at Org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal (characterencodingfilter.java:88) at Org.springframework.web.filter.OncePerRequestFilter.doFilter (onceperrequestfilter.java:107) at Org.apache.catalina.core.ApplicationFilterChain.internalDoFilter (applicationfilterchain.java:241) at Org.apache.catalina.core.ApplicationFilterChain.doFilter (applicationfilterchain.java:208) at Org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter (Proxiedfilterchain.java:61) at Org.apache.shiro.web.servlet.AdviceFilter.executeChain (advicefilter.java:108) at Org.apache.shiro.web.servlet.AdviceFilter.doFilterInternal (advicefilter.java:137) at Org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter (onceperrequestfilter.java:125) at Org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter (proxiedfilterchain.java:66) at Org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain (abstractshirofilter.java:449) at Org.apache.shiro.web.servlet.abstractshirofilter$1.call (abstractshirofilter.java:365) at Org.apache.shiro.subject.support.SubjectCallable.doCall (subjectcallable.java:90) at Org.apache.shiro.subject.support.SubjectCallable.call (subjectcallable.java:83) at Org.apache.shiro.subject.support.DelegatingSubject.execute (delegatingsubject.java:383) at Org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal (abstractshirofilter.java:362) at Org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter (onceperrequestfilter.java:125) at Org.springframework. Web.filter.DelegatingFilterProxy.invokeDelegate (delegatingfilterproxy.java:344) at Org.springframework.web.filter.DelegatingFilterProxy.doFilter (delegatingfilterproxy.java:261) at Org.apache.catalina.core.ApplicationFilterChain.internalDoFilter (applicationfilterchain.java:241) at Org.apache.catalina.core.ApplicationFilterChain.doFilter (applicationfilterchain.java:208) at Org.apache.catalina.core.StandardWrapperValve.invoke (standardwrappervalve.java:220) at Org.apache.catalina.core.StandardContextValve.invoke (standardcontextvalve.java:122) at Org.apache.catalina.authenticator.AuthenticatorBase.invoke (authenticatorbase.java:501) at Org.apache.catalina.core.StandardHostValve.invoke (standardhostvalve.java:171) at Org.apache.catalina.valves.ErrorReportValve.invoke (errorreportvalve.java:103) at Org.apache.catalina.valves.AccessLogValve.invoke (accesslogvalve.java:950) at Org.apache.catalina.core.StandardEngineValve.invoke (standardenginevalve.java:116) at Org.apache.catalina.connector.CoyoteAdapter.servIce (coyoteadapter.java:408) at Org.apache.coyote.http11.AbstractHttp11Processor.process ( abstracthttp11processor.java:1070) at Org.apache.coyote.abstractprotocol$abstractconnectionhandler.process ( abstractprotocol.java:611) at Org.apache.tomcat.util.net.jioendpoint$socketprocessor.run (JIoEndpoint.java:316) at Java.util.concurrent.ThreadPoolExecutor.runWorker (threadpoolexecutor.java:1145) at Java.util.concurrent.threadpoolexecutor$worker.run (threadpoolexecutor.java:615) at Org.apache.tomcat.util.threads.taskthread$wrappingrunnable.run (taskthread.java:61) at Java.lang.Thread.run ( thread.java:745) caused By:com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException:You has an error in your SQL Syntax Check the manual-corresponds to your MySQL server version for the right syntax-use-near "at line 1at Sun.reflect . Nativeconstructoraccessorimpl.newinstance0 (Native Method) at Sun.reflect.NativeConstructorAccessorImpl.newInstance (nativeconstructoraccessorimpl.java:57) at Sun.reflect.DelegatingCOnstructoraccessorimpl.newinstance (delegatingconstructoraccessorimpl.java:45) at Java.lang.reflect.Constructor.newInstance (constructor.java:526) at Com.mysql.jdbc.Util.handleNewInstance ( util.java:411) at Com.mysql.jdbc.Util.getInstance (util.java:386) at Com.mysql.jdbc.SQLError.createSQLException ( sqlerror.java:1053) at Com.mysql.jdbc.MysqlIO.checkErrorPacket (mysqlio.java:4074) at Com.mysql.jdbc.MysqlIO.checkErrorPacket (mysqlio.java:4006) at Com.mysql.jdbc.MysqlIO.sendCommand (Mysqlio.java : 2468) at Com.mysql.jdbc.MysqlIO.sqlQueryDirect (mysqlio.java:2629) at Com.mysql.jdbc.ConnectionImpl.execSQL ( connectionimpl.java:2713) at Com.mysql.jdbc.StatementImpl.executeUpdate (statementimpl.java:1794) at Com.mysql.jdbc.StatementImpl.executeUpdate (statementimpl.java:1712) at Org.apache.commons.dbcp.DelegatingStatement.executeUpdate (delegatingstatement.java:225) at Org.hibernate.jdbc.WorkExecutor.executeReturningWork (workexecutor.java:72) at Org.hibernate.internal.SessionImpl $3.accept (sessionimpl.java:2052) at Org.hiBernate.engine.jdbc.internal.JdbcCoordinatorImpl.coordinateWork (jdbccoordinatorimpl.java:313) ... More

2. Cause of error

Due to the concatenation of the SQL statement, the start time given is Yyyy-mm-dd HH:mm:ss, but the value given when the value is: 2015-08-01:00, resulting in an error


3. Solutions

(1) Format the value of the time, guaranteed to be yyyy-mm-dd HH:mm:ss format

(2) Format the time in the SQL statement

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

You have a error in your SQL syntax; check the manual, corresponds to your MySQL server version

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.