zoukankan      html  css  js  c++  java
  • 使用mysql关键字做类字段名报的错,花了我一个钟,坑啊

    com.modelsystem.po.ProjectPlan@701faaed
    Hibernate: insert into ld.project_plan (addTime, describe, executeTime, fileAddress, from, latitude, longitude, name, report, state, type, id) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
    ERROR  org.hibernate.util.JDBCExceptionReporter
    You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'describe, executeTime, fileAddress, from, latitude, longitude, name, report, sta' at line 1
    ERROR  org.hibernate.event.def.AbstractFlushingEventListener
    Could not synchronize database state with session
    org.hibernate.exception.SQLGrammarException: Could not execute JDBC batch update
     at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:90)
     at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
     at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:275)
     at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:266)
     at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:167)
     at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321)
     at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:50)
     at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1028)
     at org.springframework.orm.hibernate3.HibernateAccessor.flushIfNecessary(HibernateAccessor.java:390)
     at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:420)
     at org.springframework.orm.hibernate3.HibernateTemplate.executeWithNativeSession(HibernateTemplate.java:374)
     at org.springframework.orm.hibernate3.HibernateTemplate.save(HibernateTemplate.java:694)
     at com.modelsystem.dao.impl.BaseDaoImpl.save(BaseDaoImpl.java:35)
     at test.PlanTest.add(PlanTest.java:33)
     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.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
     at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
     at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:73)
     at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:46)
     at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:180)
     at org.junit.runners.ParentRunner.access$000(ParentRunner.java:41)
     at org.junit.runners.ParentRunner$1.evaluate(ParentRunner.java:173)
     at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
     at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
     at org.junit.runners.ParentRunner.run(ParentRunner.java:220)
     at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:46)
     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: java.sql.BatchUpdateException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'describe, executeTime, fileAddress, from, latitude, longitude, name, report, sta' at line 1
     at com.mysql.jdbc.PreparedStatement.executeBatchSerially(PreparedStatement.java:2024)
     at com.mysql.jdbc.PreparedStatement.executeBatch(PreparedStatement.java:1449)
     at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeBatch(NewProxyPreparedStatement.java:1723)
     at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:70)
     at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:268)
     ... 35 more
    Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'describe, executeTime, fileAddress, from, latitude, longitude, name, report, sta' at line 1
     at 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:1052)
     at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3597)
     at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3529)
     at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1990)
     at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2151)
     at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2625)
     at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2119)
     at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2415)
     at com.mysql.jdbc.PreparedStatement.executeBatchSerially(PreparedStatement.java:1976)
     ... 39 more
    ERROR  com.modelsystem.dao.impl.ProjectPlanDaoImpl
    class com.modelsystem.po.ProjectPlan [保存]异常信息  :
    org.springframework.dao.InvalidDataAccessResourceUsageException: Could not execute JDBC batch update; nested exception is org.hibernate.exception.SQLGrammarException: Could not execute JDBC batch update
     at org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:630)
     at org.springframework.orm.hibernate3.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:412)
     at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:424)
     at org.springframework.orm.hibernate3.HibernateTemplate.executeWithNativeSession(HibernateTemplate.java:374)
     at org.springframework.orm.hibernate3.HibernateTemplate.save(HibernateTemplate.java:694)
     at com.modelsystem.dao.impl.BaseDaoImpl.save(BaseDaoImpl.java:35)
     at test.PlanTest.add(PlanTest.java:33)
     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.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
     at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
     at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:73)
     at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:46)
     at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:180)
     at org.junit.runners.ParentRunner.access$000(ParentRunner.java:41)
     at org.junit.runners.ParentRunner$1.evaluate(ParentRunner.java:173)
     at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
     at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
     at org.junit.runners.ParentRunner.run(ParentRunner.java:220)
     at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:46)
     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.hibernate.exception.SQLGrammarException: Could not execute JDBC batch update
     at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:90)
     at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
     at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:275)
     at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:266)
     at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:167)
     at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321)
     at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:50)
     at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1028)
     at org.springframework.orm.hibernate3.HibernateAccessor.flushIfNecessary(HibernateAccessor.java:390)
     at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:420)
     ... 28 more
    Caused by: java.sql.BatchUpdateException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'describe, executeTime, fileAddress, from, latitude, longitude, name, report, sta' at line 1
     at com.mysql.jdbc.PreparedStatement.executeBatchSerially(PreparedStatement.java:2024)
     at com.mysql.jdbc.PreparedStatement.executeBatch(PreparedStatement.java:1449)
     at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeBatch(NewProxyPreparedStatement.java:1723)
     at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:70)
     at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:268)
     ... 35 more
    Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'describe, executeTime, fileAddress, from, latitude, longitude, name, report, sta' at line 1
     at 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:1052)
     at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3597)
     at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3529)
     at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1990)
     at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2151)
     at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2625)
     at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2119)
     at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2415)
     at com.mysql.jdbc.PreparedStatement.executeBatchSerially(PreparedStatement.java:1976)
     ... 39 more

  • 相关阅读:
    Python字符编码详解
    Python 编程规范
    希尔排序
    浅析 Python 的 metaclass
    c#通过数据集生成浏览页面
    QQ搜索群参数详解
    扩展名为HTM或HTML的文件图标不能正常显示的解决方案
    利用QQ2009协议,将抓包直接解密出ClientKey(SessionKey)
    用Sql语句还原,分离,删除数据库连接
    asp.net 导出excel 问题 (服务器的部署)
  • 原文地址:https://www.cnblogs.com/mynona/p/3364512.html
Copyright © 2011-2022 走看看