Hibernate SQL方言 (hibernate.dialect)
来源:互联网 发布:淘宝二手市场家具 编辑:程序博客网 时间:2024/03/29 18:27
Hibernate SQL方言 (hibernate.dialect) 方言配置不正确 就会出现下面的异常
Hibernate: select top ? user2x0_.user_id as user1_0_, user2x0_.userName as userName0_, user2x0_.passWord as passWord0_, user2x0_.createTime as createTime0_, user2x0_.expireTime as expireTime0_ from user user2x0_
14:57:01,062 WARN JDBCExceptionReporter:71 - SQL Error: 1064, SQLState: 42000
14:57:01,062 ERROR JDBCExceptionReporter:72 - Syntax error or access violation message from server: "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 '? user2x0_.user_id as user1_0_, user2x0_.userName as userName0_, user2x0_.passWo' at line 1"
org.hibernate.exception.SQLGrammarException: could not execute query
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:67)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.loader.Loader.doList(Loader.java:2147)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2028)
at org.hibernate.loader.Loader.list(Loader.java:2023)
at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:393)
at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:338)
at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
at test.huan009.hibernate.QuertTest.testSaveFenYe(QuertTest.java:46)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at junit.framework.TestCase.runTest(TestCase.java:154)
at junit.framework.TestCase.runBare(TestCase.java:127)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:79)
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.SQLException: Syntax error or access violation message from server: "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 '? user2x0_.user_id as user1_0_, user2x0_.userName as userName0_, user2x0_.passWo' at line 1"
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2746)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1532)
at com.mysql.jdbc.ServerPreparedStatement.serverPrepare(ServerPreparedStatement.java:1431)
at com.mysql.jdbc.ServerPreparedStatement.<init>(ServerPreparedStatement.java:144)
at com.mysql.jdbc.Connection.prepareStatement(Connection.java:1288)
at com.mysql.jdbc.Connection.prepareStatement(Connection.java:1260)
at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:497)
at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:415)
at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:139)
at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1560)
at org.hibernate.loader.Loader.doQuery(Loader.java:661)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
at org.hibernate.loader.Loader.doList(Loader.java:2144)
... 27 more
-----------------------------------------------数据库方言配置-------------------------------------------------------------
RDBMS 方言
- Hibernate SQL方言 (hibernate.dialect)
- Hibernate SQL方言 (hibernate.dialect)
- Hibernate SQL方言 (hibernate.dialect)
- Hibernate SQL方言 (hibernate.dialect)
- Hibernate SQL方言 (hibernate.dialect)
- Hibernate SQL方言 (hibernate.dialect)
- Hibernate SQL方言 (hibernate.dialect)
- Hibernate SQL方言 (hibernate.dialect)
- Hibernate SQL方言 (hibernate.dialect)
- Hibernate SQL方言 (hibernate.dialect)
- Hibernate SQL 方言 hibernate.dialect
- Hibernate SQL方言 (hibernate.dialect)
- Hibernate SQL方言 (hibernate.dialect)
- Hibernate SQL方言 (hibernate.dialect) 设置
- Hibernate SQL方言 (hibernate.dialect) 汇总
- Hibernate SQL方言 (hibernate.dialect) 汇总
- Hibernate SQL方言 (hibernate.dialect) 汇总
- Hibernate SQL 方言(hibernate.dialect)
- 世界上到底有多少牛人?
- 难忘的一件事
- resin配置与使用
- 函数引用形参问题
- 什么是组态软件(转)
- Hibernate SQL方言 (hibernate.dialect)
- SOAP与AXIS2入门教程(附带实例)(转)
- 2000年IT界着实发生了不少事
- XDoclet基本任务手册
- JSP和JSF合并 共同打造完美的Web应用(转)
- JSP学习笔记(1) -- JSP 2.0基础
- 常用数据库JDBC连接写法(转)
- 可以删除重复记录的SQL语句
- Java连接SQL Server 2000(转)