lap*_*ots 2 java postgresql spring-security
我决定通过添加身份验证使用spring security和数据库来修改我的应用程序.我用的是用普通的身份验证之前user和passwordXML格式.它工作正常.
我authentication-manager看起来像这样
<authentication-manager>
<authentication-provider>
<jdbc-user-service data-source-ref="dataSource"
users-by-username-query="select username, password from pmc.username_password where username=?;"
authorities-by-username-query="select a.username, b.role from pmc.username_password a, pmc.username_role b where a.username = b.username and a.username=?;" />
</authentication-provider>
</authentication-manager>
Run Code Online (Sandbox Code Playgroud)
但是,当我尝试进行身份验证时,我有异常
org.springframework.security.authentication.InternalAuthenticationServiceException: PreparedStatementCallback; SQL [select u
sername, password from pmc.username_password where username=?;]; The column index is out of range: 3, number of columns: 2.;
nested exception is org.postgresql.util.PSQLException: The column index is out of range: 3, number of columns: 2.
Run Code Online (Sandbox Code Playgroud)
我sql在XML文件中的语法有什么问题?