Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL
来源:互联网 发布:mac word转pdf 白边 编辑:程序博客网 时间:2024/05/16 08:13
1、错误描述
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 com.skycloud.oa.base.dao.impl.BaseDaoImpl.executeQuery(BaseDaoImpl.java:138)at com.skycloud.oa.business.dao.impl.StoreDynamicDaoImpl.queryDynamicChart(StoreDynamicDaoImpl.java:88)at com.skycloud.oa.test.business.dao.StoreDynamicDaoTest.testQueryDynamicChart(StoreDynamicDaoTest.java:77)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:47)at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:74)at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:83)at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:72)at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:233)at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:87)at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:71)at org.junit.runners.ParentRunner.run(ParentRunner.java:309)at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:176)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:459)at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)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 'where 1=1' 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:2719)at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2155)at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:2318)at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:92)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)... 33 more
2、错误原因
由于没有建数据库表,在拼接SQL语句时,未将表拼接进去,导致出错
3、解决办法
在数据库中新建业务查询表,拼接好SQL语句
1 0
- Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL
- Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL
- com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax.....
- com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax;解决办法
- com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax解决办法
- 解决com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax;错误
- com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax;
- mybatis报“com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL s”
- com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; che
- com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; che
- com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax
- com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; che
- com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: You have an error in your SQL syntax;
- com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in
- Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: 解决方案
- Spring JPA-Hibernate报错:com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an er解决方案
- Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column ""in 'field lis
- Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'XXX' in 'whe
- (十五) YII2 将参数传递到layouts/main.php中
- poj 3069 贪心算法
- uva 11552(dp)
- (十六)yii2 视图中渲染到另一个视图中
- 简单链表操作
- Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL
- 关于苹果《Genius Bar 天才吧》预约流程
- java-集合类(二)-迭代器-Iterator-Collections类自然排序
- linux系统-进程管理-基本概念和命令
- objective_c 第九章课后练习题答案
- 湘潭大学oj 1195
- Difference between “git add -A” and “git add .” and "git add -u"
- 学习SQL Server推荐的10本书
- android知识点