ToB企服应用市场:ToB评测及商务社交产业平台

标题: SQLSyntaxErrorException: You have an error in your SQL syntax [打印本页]

作者: 郭卫东    时间: 2022-8-10 04:04
标题: SQLSyntaxErrorException: You have an error in your SQL syntax
  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语句中字段的引号问题导致。


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




欢迎光临 ToB企服应用市场:ToB评测及商务社交产业平台 (https://dis.qidao123.com/) Powered by Discuz! X3.4