- 浏览: 1989189 次
- 性别:
- 来自: 深圳
文章分类
- 全部博客 (509)
- JavaEE (122)
- Oracle数据库 (29)
- JavaScript (37)
- SAP (5)
- MySql数据库 (7)
- JavaSE (4)
- Ajax (1)
- jQuery (13)
- SSH框架 (36)
- Web Service (10)
- JSF框架 (2)
- JBPM (0)
- ireport报表 (2)
- ibatis (5)
- Hibernate (31)
- JSP (11)
- Tomcat 服务器 (20)
- Other (19)
- JavaWeb (4)
- Maven (11)
- OSWorkFlow (10)
- HTML (13)
- Exception汇总 (7)
- SVN (2)
- 笑话 (1)
- JSTL (1)
- WebSphere Message Broker (13)
- ANT命令 (3)
- Liunx (12)
- Struts2 (26)
- Eclipse (6)
- DOS (3)
- Flex (11)
- WebSphere (1)
- 开发常用工具 (3)
- Junit (2)
- EJB (4)
- Struts1.2 (2)
- Jboss (1)
- Android (2)
- Java框架源码解析 (1)
- Spring (4)
- MyBatis (6)
- SpringMVC (4)
- Jetty (2)
- 数据库表设计 (1)
- SSO (4)
最新评论
-
贝塔ZQ:
也可以试试PageOffice插件,觉得更简单点
Jxl操作Excel设置背景、字体颜色、对齐方式、列的宽度 -
jia1208:
...
Could not publish server configuration for Tomcat v6.0 Server at localhost. -
u011274527:
赞
java.io.EOFException java.io.ObjectInputStream$PeekInputStream.readFully 错误 -
旭旭小牛啦:
怎么没哟了,继续赛
jQuery 选择器 -
wzw3919:
100行会报空指针
Java 解压缩zip文件
Hibernate 与 MySql 数据库关键字冲突You have an error in your SQL syntax; check the manual
- 博客分类:
- Hibernate
诶..说来,实在是惭愧.一个错误.害惨我了..搞了几个小时.. 今天使用JSF+Spring+Hibernate框架 和mysql数据库做项目时,发生一个异常..
我万万没有想到..居然是关键字,所引起的..
具体Hibernate生成的sql语句如下:
Hibernate:
insert
into
pl_roles_acl
(ROLE_NAME, SORT_ORDER, RESOURCE_NAME, READ, CREATE, UPDATE
, DELETE, EXECUTE)
values
(?, ?, ?, ?, ?, ?, ?, ?)
2011-01-05 15:55:27,296 [WARN ] org.hibernate.util.JDBCExceptionReporter - SQL Error: 1064, SQLState: 42000
2011-01-05 15:55:27,296 [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 'READ, CREATE, UPDATE, DELETE, EXECUTE) values ('SAP', 4, 'userMaintenance', 0, 0' at line 1
2011-01-05 15:55:27,296 [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:90)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:275)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:266)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:171)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:50)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1028)
at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:366)
at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:137)
at org.springframework.orm.hibernate3.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:655)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:732)
做项目的时候, 朋友们, 千万要避免mysql或者其他数据有关键字的问题..
如果有关键字 ..
也可以,在所对应的 .XXX.Hibernate.hbm.xml 文件里面改 ,具体操作如下:
看红色的标记,. 在关键字中 加 "[]" .或者 加, \" \" 或者 '"READ" '..都行
<!-- 在角色对象中拿到所有的权限;-->
<list name="acEntry" lazy="false" table="pl_roles_acl" >
<key column="ROLE_NAME" />
<list-index base="0" column="SORT_ORDER"/>
<composite-element class="com.rs.common.core.model.AccessControlEntry" >
<property name="entryName" type="java.lang.String">
<column name="RESOURCE_NAME" sql-type="varchar" not-null="true" />
</property>
<property name="permissionRead" >
<column name="[READ]" not-null="false" />
</property>
<property name="permissionCreate">
<column name="[CREATE]" not-null="false" />
</property>
<property name="permissionModify">
<column name="[UPDATE]" not-null="false" />
</property>
<property name="permissionDelete">
<column name="[DELETE]" not-null="false" />
</property>
<property name="permissionExecute">
<column name="[EXECUTE]" not-null="false" />
</property>
</composite-element>
</list>
发表评论
-
大型互联网服务集成平台:springmvc+mybatis+restfull+JMS+webservice+bootstrap
2015-04-12 23:36 22SpringMVC + Mybatis + SpringS ... -
Spring中二级缓存的配置
2011-12-18 20:40 22301.首先,在spring的hibernate配置里(app ... -
Hibernate 配置文件提示
2011-12-11 16:03 10311.这个则是hibernate.cfg.xml文件的头信息.. ... -
Hibernate中二级缓存的配置
2011-10-18 00:26 1256我们知道 hibernate的session提供了一级缓存, ... -
Hibernate 生成策略属性
2011-10-17 14:01 1011"assigned" 主键由外部程序负责生 ... -
Exception in thread "main" java.lang.NoClassDefFoundError: javax/transaction/Syn
2011-10-16 18:37 2463Exception in thread "main& ... -
Hibernate缓存的分类
2011-10-16 11:25 1029Hibernate缓存分类: Session ... -
在Hibernate中使用日期函数获取数据库时间
2011-10-04 20:13 1671在Hibernate中使用日期函数获取数据库时间 ... -
Hibernate关联映射-one to one主键双向关联
2011-09-23 01:11 1315这次,继续上一次的实例。 记录1对1 主键双向关联. ... -
Exception in thread "main" org.hibernate.id.IdentifierGenerationException: attem
2011-09-23 00:46 2062今天在做Hibernate中1多1双向关联映射的实例时, ... -
Hibernate关联映射-one to one 外键双向关联.
2011-09-22 00:28 1168说明:双向一对一,是一对多的特例,只需要在多的一方设置成 ... -
Hibernate关联映射-many to many 外键单向关联.
2011-09-20 01:18 1450多对多的实例很多,这里说一个比较简单的例子,而且还是单向 ... -
Hibernate关联映射-many to one 外键单向关联
2011-09-18 00:25 1955多个人可以对应一个地址,也就是所谓的多对一关系,many to ... -
Hibernate关联映射-one to to 主键单向关联
2011-09-17 23:23 1046这次介绍 还是以Person 和 Address 为例. ... -
Hibernate关联映射-one to many外键单向关联
2011-09-15 01:14 4587以下是说明,1对多 单向外键关联 的实例.同样以person ... -
Hibernate关联映射-one to one单向外键关联
2011-09-13 22:00 1649Hibernate的关联关系很多,也非常的复杂. 常见的有 ... -
org.hibernate.TransientObjectException: object references an unsaved transient i
2011-09-12 19:02 1484org.hibernate.TransientObjectEx ... -
org.hibernate.PropertyAccessException: Exception occurred inside getter of pack.
2011-09-12 18:54 6124报如下,异常是因为,在Person对象中.设置的属性类型 ... -
org.hibernate.MappingException: could not instantiate id generator
2011-09-10 14:32 2473在搭建Hibernate的环境时, ... -
配置hibernate.properties 或 hibernate.cfg.xml 文件时,在配置JDBC连接参数时,要配置数据库方言
2011-09-10 13:04 1931各数据库的方言 (配置 hibernate.cfg.xml 时 ...
相关推荐
在编写自己的程序时,需要实现将数据导入数据库,并且是带参数的传递。 执行语句如下: sql_str = INSERT INTO teacher(t_name, t_...ProgrammingError: (1064, “You have an error in your SQL syntax; check the m
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 ‘(0) NOT NULL, endTime datetime(0) NOT NULL,avaliableTime int(8) ...
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 'identified by 'password' with grant option' mysql 5和mysql 8都有...
mysql_exporter消除了"Error 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 'SLAVE STATUS' at line 1...
### The error occurred while setting parameters ### SQL: SELECT * FROM Domain_System WHERE domain = ? LIMIT 1 ### Cause: ...
ERROR 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 'mysqltump -u root -p sa > D:/sa.sql' at line ...
本文实例讲述了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 ‘type=InnoDB’ at line 1 二、解决方案
前几天帮同事解决一个案例,在主从复制环境下,从库上的MySQL版本号是5.5.5,... Last_Error: Error 'You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for t
我们现在一般网站都是利用的MySQL数据库搭建网站的,但是在网上看到很多网友吐槽数据库连接不上的问题,现在我就结合相关资料向提出一些我个人的见解,希望对大家解决问题有帮助。 一般MySQL连接不上,可能有两大...
首先,我们要理解JDBC(Java Database Connectivity)是Java平台中用于与各种数据库进行交互的一种标准接口。JMeter的JDBC Request sampler允许我们直接在测试计划中执行SQL查询,插入、更新或删除数据,以及处理...
mysqldump: Couldn’t execute ‘SET OPTION SQL_QUOTE_SHOW_CREATE=1’: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use ...
在搭建springmvc框架时,底层使用... 代码如下:[13-04-13 19:11:37.190] {resin-60} You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right synt
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server versio····这句话对于咱们并不陌生,无非就是多了“,”之类的问题。但是你如果无意之中添加了一个mysql中的...
java.servlet.ServletException: com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right ...
6. 错误代码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 '...' at line X",提示SQL语句中的语法错误,需要...
操作发生错误,相关的信息为:[MySQL][ODBC 3.51 Driver][mysqld-4.0.26-nt]You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use ...
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 ‘`company_id` int) RETURNS varchar(20) CHARSET utf8 ...
尝试在线模式更改docker-compose up mysql-master mysql-replica 使用initial_data.sql加载数据改变的方法迭代1(Vanila alter。无效) ALTER TABLE try...ERROR 1064 ( 42000 ): You have an error in your SQL syntax