从错误看FOR UPDATE 子句仅允许用于 DECLARE CURSOR这个只允许在存储过程里面使用。
解决方案 »
- java swing:如何设置文本框输入日文完毕后自动回车?
- 征集意见
- ssh如何整合及详细步骤
- 想知道这几个类的作用,帮忙写下注释
- 数据库表有记录,但hibernate的session.createQuery返回空值??
- 我的合同问题,懂这方面的人过来回答一下。
- 关于数据库返回的ResultSet结果
- 网页布局使用webwork2还是struts好?
- EJB这么火,决定开始学习,请各位大牛指教,初学该看什么书?
- tomcat加载工程的时候出错【有图】
- 在jsp页面中操作,交给javabean处理然后返回jsp 页面,为什么要用到servlet呢?本人对servlet就是不通,请高手多指教
- Tomact能正常用但是启动以后会有如下错误,请大虾帮帮忙
43578 [http-8088-Processor24] ERROR org.hibernate.util.JDBCExceptionReporter - 第 1 行: 'limit' 附近有语法错误。
43609 [http-8088-Processor24] ERROR com.easyjf.web.core.DefaultRequestProcessor - 出现错误:org.springframework.orm.jpa.JpaSystemException: org.hibernate.exception.SQLGrammarException: could not execute query; nested exception is javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not execute query
org.springframework.orm.jpa.JpaSystemException: org.hibernate.exception.SQLGrammarException: could not execute query; nested exception is javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not execute query
Caused by: javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not execute query
at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:629)
at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:73)
at com.easyjf.core.dao.impl.GenericDAOImpl$1.doInJpa(GenericDAOImpl.java:79)
at org.springframework.orm.jpa.JpaTemplate.execute(JpaTemplate.java:192)
at org.springframework.orm.jpa.JpaTemplate.execute(JpaTemplate.java:157)
limit是MYSQL的语法了,显然的我数据库言设置没有作用
<persistence xmlns="http://java.sun.com/xml/ns/persistence" version="1.0">
<persistence-unit name="ejs-app-unit" transaction-type="RESOURCE_LOCAL">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.SQLServerDialect" />
<property name="hibernate.show_sql" value="true" />
<property name="hibernate.hbm2ddl.auto" value="update" />
<property name="hibernate.cache.provider_class" value="org.hibernate.cache.EhCacheProvider" />
<property name="hibernate.cache.use_query_cache" value="false" />
</properties>
</persistence-unit>
</persistence>
<bean name="entityManagerFactory"
class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
<property name="persistenceXmlLocation"
value="classpath:persistence.xml" />
<property name="dataSource" ref="dataSource" />
<property name="jpaVendorAdapter">
<bean
class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
<!-- <property name="database" value="MYSQL" /> -->
<property name="showSql" value="false" />
<property name="generateDdl" value="false" />
</bean> </property>
</bean>
就是上面被我注释掉的部分啦,散分了