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 ...
随机推荐
- AQS的数据结构及实现原理
接下来从实现角度来分析同步器是如何完成线程同步的.主要包括:同步队列.独占式同步状态获取与释放.共享式同步状态获取与释放以及超时获取同步状态等. 1.同步队列 同步器依赖内部的一个同步队列来完成同步状 ...
- Android开发_如何调用系统默认浏览器访问
Android开发_如何调用系统默认浏览器访问 2015-10-20 17:53 312人阅读 http://blog.sina.com.cn/s/blog_6efce07e010142w7.htm ...
- LaTex 2
LaTex 入门 此时是否安装成功 如果安装成功了LaTeX, 那么在计算机上会多出来LaTeX的编译器, LaTex Live 安装包在计算机上安装了多个不同的编译器, 有latex, xelate ...
- BNU34067——Pair——————【找规律】
Pair Time Limit: 1000ms Memory Limit: 65536KB 64-bit integer IO format: %lld Java class name: M ...
- Hibernate中的一对一注解配置
Card类 package cn.OneToOne2017109.entity; import javax.persistence.*; /** * Created by YSS on 2017/10 ...
- 前端框架——Bootstrap
一.Bootstrap介绍 凡是使用过bootstrap的开发者,不外乎做这么两件事情:复制and粘贴. Bootstrap官方网址:http://www.bootcss.com Bootstrap, ...
- Revolution of Unix
- .NET开源工作流RoadFlow-表单设计-组织机构选择
组织机构选择即在表单中添加组织机构选择框. 选择范围: 1.发起者部门:只能在发起者同一个部门中选择. 2.处理者部门:只能在当前处理者同一个部门中选择. 3.自定义:自己指定一个选择范围. 选择类型 ...
- 05_Jedis操作Redis
[工程截图] [String类型操作] package com.higgin.string; import java.util.List; import redis.clients.jedis.Jed ...
- 使用gulp解决外部编辑器修改Eclipse文件延迟刷新
本人前端用惯了Hbuilder,修改了eclipse项目中的文件后,由于是外部编辑器修改过的,eclipse不会自动部署更新,一般按F5刷新项目,或者在 preferences > genera ...