mysql中表名是order的CRUD的错误
org.springframework.jdbc.BadSqlGrammarException:
### Error querying database. Cause: 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 'order WHERE id = 5' at line 1
### The error may exist in file [I:\workspace\workspace_wxjc\creation-help\creation-help-server\target\classes\mybatis\mapper\order-mapper.xml]
### The error may involve com.wxjc.creation.dao.impl.OrderDAOImpl.getById-Inline
### The error occurred while setting parameters
### SQL: SELECT * FROM order WHERE id = ?
### Cause: 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 'order WHERE id = 5' at line 1
; bad SQL grammar []; nested exception is 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 'order WHERE id = 5' at line 1
at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:237)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72)
at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:71)
at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:365)
at com.sun.proxy.$Proxy23.selectOne(Unknown Source)
at org.mybatis.spring.SqlSessionTemplate.selectOne(SqlSessionTemplate.java:160)
at com.nskbearing.core.dao.BaseDAOImpl.getById(BaseDAOImpl.java:125)
以上是错误提示,提示:
SELECT * FROM order WHERE id = ?;
提示org.springframework.jdbc.BadSqlGrammarException:
放到mysql的客户端执行,也报错
SELECT * FROM order WHERE id = 1;
/* SQL错误(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 'order WHERE id = 1' at line 1 */
/* Affected rows: 0 已找到记录: 0 警告: 0 持续时间 0 of 1 query: 0.000 sec. */
最终解决:
SELECT * FROM `order` WHERE id = 1; 这样解决了。
在mybatis中使用:
<sql id="t_order">`order`</sql> 解决!!!
mysql中表名是order的CRUD的错误的更多相关文章
- MySQL中表名大小写问题
在设计数据表时,有自己特有的规则:英文单词的首字母大写,比如表名User, Article, UserRole, 等等,这种办法使用得很顺手习惯,在以往使用的MS SQL Server.MS Acce ...
- MySQL中表名重命名
第一种办法:##修改表名, TO 或AS都可以,也以省略掉 ## ALTER TABLE 表名 RENAME [TO|AS] 新表名 ALTER TABLE user10 RENAME TO user ...
- MySQL表名和数据库关键字相同解决办法
今天改他们的代码的时候,遇到了MySQL表名和数据库关键字的问题. 由于表名是关键字,导致增删改查都报错. Hibernate: select leave0_.id as id22_, leave0_ ...
- [mysql] mysql表名忽略大小写
首先查看mysql是否区分大小写: 今天郁闷死了,在LINUX下调一个程序老说找不到表,但是我明明是建了表的,在MYSQL的命令行下也可以查到,为什么程序就找不到表呢? 后来请教了一个老师才搞定,原来 ...
- 【转】MySQL表名大小写敏感导致的问题
原文地址:https://blog.csdn.net/postnull/article/details/72455768 最近在项目中遇到一个比较奇怪的小问题.在开发过程中自己测试没有问题,但是提测后 ...
- MySQL表名大小写敏感导致的问题
最近在项目中遇到一个比较奇怪的小问题.在开发过程中自己测试没有问题,但是提测后,测试的同时在测试一个功能时报错了,日志是: Caused by: com.mysql.jdbc.exceptions ...
- MySQL字段名与保留字冲突的问题及解决方法
问题:MySQL字段名与保留字冲突在实际操作是常常出现的.一把会出现下面错误. com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException. 解 ...
- 【MySql】linux下,设置mysql表名忽略大小写
[障碍再现] 状况描述01: 在LINUX下调一个程序经常报出找不到表,但是我明明是建了表的, 测试的时候,遇到一些问题,从Windows平台访问虚拟机中的Web应用,经常报出找不到表 ...
- mysql表名忽略大小写问题记录
问题描述:一开发同事在linux下调一个程序老是报错说找不到表,但是登陆mysql,show tables查看明明是已经创建了这张表的!!如下: mysql> show tables; +--- ...
随机推荐
- jQuery 元素的选中, 置顶、上移、下移、置底、删除
如截图: <ul> <li class="li01" onclick="C_columnSetTop(this)"><i>& ...
- array_flip() array_merge() array+array的使用总结
array_flip(array); //传递一个数组参数,对该数组的键.值进行翻转 例如: $a = array( 'a', 'b', 'c' ); print_r(array_flip($a)); ...
- C++ security issue analyze
https://sploitfun.wordpress.com/about-2/ “Happiness is only real when shared” – Into the wild http:/ ...
- 怎样让Oracle支持中文? 语言_地域.字符集
暂时不涉及数据库业务,但是今天入库的时候中文入库报错,考虑可能是字体不支持,留待备用. 来源:Linux社区 作者:robertkun 语言_地域.字符集SIMPLIFIED CHINESE_CHI ...
- zookeeper运维 --【】转】
from:http://blog.csdn.net/hengyunabc/article/details/19006911 zookeeper运维 尽管zookeeper在编程上有很多的阱陷,AP ...
- Kafka入门经典教程
本帖最后由 desehawk 于 2015-5-3 00:45 编辑问题导读 1.Kafka独特设计在什么地方?2.Kafka如何搭建及创建topic.发送消息.消费消息?3.如何书写Kafka程 ...
- 安装使用ubuntu和opensuse
liquid: n.液体, adj. 液体的, 流动的 liquidate: v. 清洗; 清算; 变现; 杀戮; weird: [wi2d] e:i, ir:2 离奇的,古怪的... 英文名称, 直 ...
- 有关jquery checkbox获取checked的问题
$("input").attr("checked"); <input type="checkbox" value="1&qu ...
- ProgressBar样式(转)
普通圆形ProgressBar 该类型进度条也就是一个表示运转的过程,例如发送短信,连接网络等等,表示一个过程正在执行中. 一般只要在XML布局中定义就可以了. <progressBar and ...
- IEnumerable<> ICollection <> IList<> 区别
IEnumerable< ICollection < IList区别 public interface IEnumerable { IEnumerator GetEnumerator(); ...