用mysql在Spring Security中配置的问题,求牛人帮忙解答!!!
连接mysql无问题
两句查询语句如下:
<authentication-provider>
<jdbc-user-service data-source-ref="dataSource"
users-by-username-query="select student.username,student.password, status.status as enabled from student left join status on status.id=student.id where student.username='?'"
authorities-by-username-query="select student.username,role_table.descn as authority from student left join student_role_student on student_role_student.student=student.ID left join student_role_role_table on student_role_role_table.student_role=student_role_student.student_role left join role_table on role_table.id=student_role_role_table.role_table where student.username='?'"/>
</authentication-provider>
这两句单独在mysql中运行,将‘?’换成用户名后,无问题
但是在这个web应用中运行登陆却出现这个提示,无法进行登录:
Your login attempt was not successful, try again.
Reason: PreparedStatementCallback; bad SQL grammar [SELECT username,password,enabled FROM users WHERE username = ?]; nested exception is com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: Table 'score.users' doesn't exist; nested exception is org.springframework.jdbc.BadSqlGrammarException: PreparedStatementCallback; bad SQL grammar [SELECT username,password,enabled FROM users WHERE username = ?]; nested exception is com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: Table 'score.users' doesn't exist
求大神帮忙解答!!!!!跪谢!!!