1.编写userMapping.xml时报错,
Error querying database. 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 ‘‘easyuser’ WHERE usernam e = ‘admin’ ANDpassword
= ‘123456’
AND state = 1’ at line 1 The error may exist in file
[D:\javaprojects\sportplay\sportplay\target\classes\mapper\UserMapping.xml]
The error may involve defaultParameterMap The error occurred while
setting parameters SQL: SELECT * FROM ‘easyuser’ WHERE username = ?
ANDpassword
= ? AND state = 1;
在SQL语句的表名引号使用上。在MySQL中,表名和字段名应该使用反引号而不是单引号。SQL语句中使用了单引号括起了’easyuser’,这可能导致语法错误。