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 ...
随机推荐
- TOJ 4119 Split Equally
描述 Two companies cooperatively develop a project, but they don’t like working with one another. In o ...
- (二) 修改IDEA自带的 maven 仓库
详细可见教程 :https://www.yiibai.com/testng/ 1.新建一个maven项目 Maven简介: Maven是一个项目管理和综合工具.Maven提供了开发人员构建一个完整的生 ...
- Xcode6中Swift没有智能提示和自动补全功能
今天在学习Swift的过程中,编写代码,发现没有智能提示和自动补全功能,一阵不适应,在网上溜达了下,找到了解决办法,测试可行 中文系统新建工程,copyright里有日期,2014年,“年”..然后删 ...
- 人工智能(AI)
一.人工智能的核心——机器学习 人工智能是一个很大的圈子,但人工智能的基础是机器学习. 机器学习是什么? 其实就是人告诉机器想做什么事情,并且给它一堆数据让它模仿着去做. 机器学习需要什么? 算法.数 ...
- jq on方法绑定多个事件
一.jquery为多个选择器绑定同一个事件 $("#start,#end").on("click",function(){ alert("The pa ...
- Android之侧滑导航栏
今天学习的新内容是侧滑导航栏,我想大家肯定都比较熟悉了,因为这个效果在qq里面也有,最近一直跟室友们玩的游戏是快速让自己的头像的点赞量上千.当然我的效果跟qq是没有办法比的,因为那里面的功能是在是太强 ...
- 用户选择wordpress程序建站需要知道的一些事情 - 安全、优化速度、配置
WordPress是我们使用最多的CMS程序之一,无论是我们的个人博客,还是企业网站,甚至中小型站点,我们都可以用WP程序部署.我们看到海外网站的时候,大部分都是用的WORDPRESS程序.在我们国人 ...
- Azure进阶攻略丨Azure网络通不通,PsPing&PaPing告诉你答案
很多时候,为了解决一些问题,要查各种文档,很麻烦你造吗!做「伸手党」又容易被鄙视,这时候就需要用到[Azure 进阶攻略]啦!特此,我们推出关于 Azure 常用操作指南的系列文章,每篇涉及一个 Az ...
- React学习笔记 - 元素渲染
React Learn Note 3 React学习笔记(三) 标签(空格分隔): React JavaScript 二.元素渲染 元素是构成react应用的最小单位. 元素是普通的对象. 元素是构成 ...
- IEEP-网络设计
IEEP-网络设计 网络设计概述 网络设计概述 1.负责把网络规划阶段获得的客户需求运用技术手段予以规范化体现 2.网络设计一般遵循模块化指导方针,分模块进行设计 3.网络设计的输出成果必须是规范的. ...