问题描述:ssm项目在使用postman测试时出现SQL类型bug:
Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: 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 '},
'http://localhost:8080/upload/1665841849865.jpg',1,88.0,66.6,100,' at line 18
具体来看终端显示的语句:
可以发现在sql语句中values值后出现未编译成功的#{courseImgUrl}!!!!!
来看我们dao层映射文件:
可以知道主要原因为占位符未匹配成功:在values行末的#未匹配到下一行的{