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) ~[mysql-connector-java-8.0.29.jar:8.0.29]

是因为mapper中的inser语句中字段的引号问题导致。

posted @ 2022-06-25 01:28  Shieryue  阅读(1129)  评论(0)    收藏  举报