SQLSyntaxErrorException: You have an error in your SQL syntax

打印 上一主题 下一主题

主题 564|帖子 564|积分 1692

  1. ### The error may involve com.example.bootjdbc220620.mapper.CityMapper.insert-Inline
  2. ### The error occurred while setting parameters
  3. ### SQL: INSERT into city('name','state','country') values(?,?,?)
  4. ### 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 ''name','state','country') values('jack','actived','uk')' at line 1
  5. ; 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 ''name','state','country') values('jack','actived','uk')' at line 1] with root cause
  6. 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 ''name','state','country') values('jack','actived','uk')' at line 1
  7.         at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:120) ~[mysql-connector-java-8.0.29.jar:8.0.29]
复制代码
是因为mapper中的inser语句中字段的引号问题导致。


免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

x
回复

使用道具 举报

0 个回复

倒序浏览

快速回复

您需要登录后才可以回帖 登录 or 立即注册

本版积分规则

郭卫东

金牌会员
这个人很懒什么都没写!

标签云

快速回复 返回顶部 返回列表