首页 > 其他 > 详细

Intellij 集成mybatis 查询的时候错误

时间:2021-09-05 20:09:12      阅读:19      评论:0      收藏:0      [点我收藏+]

报告 sql 语法错误,

把生成的代码,贴到sqlyog里运行,也提升错误

原因是 sql里用了sql的关键字,如lock。

    from tbl_admin
    where id = 1‘ at line 3
### The error may exist in file [D:\OneDrive\project\activiti\target\classes\mapper\AdminMapper.xml]
### The error may involve cn.taotao.dao.AdminMapper.selectByPrimaryKey-Inline
### The error occurred while setting parameters
### SQL: select            id, username, password, email, lock, birth         from tbl_admin     where id = ?
### Cause: java.sql.SQLSyntaxErrorException: 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 ‘lock, birth
   
    from tbl_admin
    where id = 1‘ at line 3
; bad SQL grammar []; nested exception is java.sql.SQLSyntaxErrorException: 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 ‘lock, birth

 

 错误中已经提到 near ‘ lock ,birth, from tbl_admin  where id =1 ‘.....

这里的错误,原因是 lock 是关键字,改为其他即可。弄了半个下午

Intellij 集成mybatis 查询的时候错误

原文:https://www.cnblogs.com/sdgtxuyong/p/15227103.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!