SQL Error: 1064, SQLState: 42000 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version
-- ::, WARN [org.hibernate.util.JDBCExceptionReporter:] - SQL Error: , SQLState:
-- ::, 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 'update, id) values ('sdf', 'sdf', 'asdfsd', '-- ::', 23)' at line
-- ::, 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:)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:)
at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:)
at org.hibernate.ejb.AbstractEntityManagerImpl$.beforeCompletion(AbstractEntityManagerImpl.java:)
at com.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple.beforeCompletion(SynchronizationImple.java:)
at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.beforeCompletion(TwoPhaseCoordinator.java:)
at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.end(TwoPhaseCoordinator.java:)
at com.arjuna.ats.arjuna.AtomicAction.commit(AtomicAction.java:)
at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commitAndDisassociate(TransactionImple.java:)
at com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.commit(BaseTransaction.java:)
at com.arjuna.ats.jbossatx.BaseTransactionManagerDelegate.commit(BaseTransactionManagerDelegate.java:)
at org.jboss.aspects.tx.TxPolicy.endTransaction(TxPolicy.java:)
at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:)
at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:)
at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:)
at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:)
at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:)
at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:)
at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:)
at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:)
at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:)
at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:)
at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:)
at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:)
at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:)
at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:)
at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:)
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 'update, id) values ('sdf', 'sdf', 'asdfsd', '-- ::', 23)' at line
at com.mysql.jdbc.PreparedStatement.executeBatchSerially(PreparedStatement.java:)
at com.mysql.jdbc.PreparedStatement.executeBatch(PreparedStatement.java:)
at com.mysql.jdbc.jdbc2.optional.StatementWrapper.executeBatch(StatementWrapper.java:)
at org.jboss.resource.adapter.jdbc.WrappedStatement.executeBatch(WrappedStatement.java:)
at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:)
... 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 'update, id) values ('sdf', 'sdf', 'asdfsd', '-- ::', 23)' at line
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:)
at com.mysql.jdbc.Util.getInstance(Util.java:)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:)
at com.mysql.jdbc.PreparedStatement.executeBatchSerially(PreparedStatement.java:)
... more
出现上面异常的原因:是因为EJB实体类中有一个自动是update,它与数据库表关联映射。update是sql语句中的关键字,因此会出错。
总结:在网上搜索了一下,这类异常大部分都是sql语句有问题。可以查看该语句中是否有关键字,拼接是否有错(引号),字段类型等。
SQL Error: 1064, SQLState: 42000 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version的更多相关文章
- 解决ROR 1064 (42000): 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 'creat table study_record( id int(11) not null
之前一直用的好好的,突然就出现了这个错误: ERROR 1064 (42000): You have an error in your SQL syntax; check the manual tha ...
- 1064 - 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 'groups)VALUES('1','hh','hh@163.com','Boss')' at line 1
mysql8.0版本 在已存在的表里插入一条数据 insert INTO api_user(id,username,email,groups)VALUES('1','hh','hh@163.com', ...
- [Err] 1064 - 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 ''<h1 style="text-align: center;">php
[Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL s ...
- MySql 执行语句错误 Err] 1064 - 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
关于用Power Designer 生成sql文件出现 错误 [Err] 1064 - You have an error in your SQL syntax; check the manual ...
- 插入mysql语句报错:1064 - 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
插入一个很简单的sql语句时候,mysql一直报错: [SQL] INSERT INTO ORDER ( id, activity_id, order_type, phone, order_amoun ...
- 插入数据库失败([Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version)
报错信息如下: , ) 原因,read是数据库的关键字, 牢记,如果一个词是数据库的关键字,那么在写数据库语句的时候,这个词一定是蓝色的(关键字颜色)!!
- 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 'varchar(255), sort integer not null
you have an error in your SQL syntax; check the manual that corresponds to your MySQL server version ...
- ERROR: 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 'type=InnoDB' at line 7
问题: 使用hibernate4.1.1,数据库使用mysql5.1.30,使用hibernate自动生成数据库表时,hibernate方言使用org.hibernate.dialect.MySQLI ...
- C# Mysql 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 ????
有几年没用过MySql数据了,今天在使用C#访问MySql数据库时出现了一个小插曲. 错误提示: You have an error in your SQL syntax; check the man ...
随机推荐
- jQuery对象和DOM对象使用说明,需要的朋友可以参考下。
jQuery对象和DOM对象使用说明,需要的朋友可以参考下.1.jQuery对象和DOM对象第一次学习jQuery,经常分辨不清哪些是jQuery对象,哪些是 DOM对象,因此需要重点了解jQuery ...
- bzoj 5314: [Jsoi2018]潜入行动
Description 外星人又双叒叕要攻打地球了,外星母舰已经向地球航行!这一次,JYY已经联系好了黄金舰队,打算联合所有JSO Ier抵御外星人的进攻.在黄金舰队就位之前,JYY打算事先了解外星人 ...
- 引用SQLHelper类configurationmanager 不存在
在使用Sqlhelper类时,出现cs0103错误 当前上下文中不存在名称configurationmanager 解决方案,除了using引用using System.Configuration外, ...
- jquery/js不支持ie9以下版本的方法或属性
1.jquery的trim()去除字符串两边的空格,在ie5~8中不支持此方法.若想替换字符串所有的空格看使用replace()正则替换: var date=" 2014-1 0- 15 ...
- Error creating bean with name 'com.cloud.feign.interfaces.xxxFeignClient': FactoryBean threw exception on object creation; nested exception is java.lang.IllegalSt.PathVariable annotation was empty on
环境: Spring Cloud:Finchley.M8 Spring Boot:2.0.0.RELEASE 报错信息: Error creating bean with name 'com.clou ...
- springmvc 登陆拦截器 配合shiro框架使用
public class LoginHandlerInterceptor extends HandlerInterceptorAdapter{ @Override public boolean pre ...
- git 创建远程版本库(亲测有效)
一.github远程版本库 1.创建SSH Key(windows) ssh-keygen -t rsa -C "youremail@example.com" 2.连接版本 ...
- 【数据库】8.0 MySQL入门学习(八)——创建并使用数据库、获得数据库和表的信息
1.0 使用SHOW语句找出服务器上当前存在什么数据库: mysql> SHOW DATABASES; 每台机器上的数据库列表是不同的,但是很可能有mysql和test数据库.mysql是必需的 ...
- H5左滑删除JS插件
<script type="text/javascript"> /** * zepto插件:向左滑动删除动效 * 使用方法:$('.itemWipe').touchWi ...
- css display:table圣杯布局
圣杯布局指的是一个网页由页眉,3等高列(2个固定侧栏和中心内容主体)和贴在页面底部的页脚组成. 主要思路是对整个容器使用地上diaplay:table 的css规则,然后分别对页眉页脚使用displa ...