郭卫东 发表于 2022-8-10 04:04:56

SQLSyntaxErrorException: You have an error in your SQL syntax

### The error may involve com.example.bootjdbc220620.mapper.CityMapper.insert-Inline
### The error occurred while setting parameters
### SQL: INSERT into city('name','state','country') values(?,?,?)
### 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
; 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

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
        at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:120) ~是因为mapper中的inser语句中字段的引号问题导致。
https://img2022.cnblogs.com/blog/1131482/202206/1131482-20220625012823066-1295581735.png

免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!
页: [1]
查看完整版本: SQLSyntaxErrorException: You have an error in your SQL syntax