title: Error with authentication in Spring sercurity
body: <p>I have created a form for a user and admin login to a web app in Spring MVC
  and I have the following config file in Spring MVC:</p>
  
  <pre><code>&lt;authentication-manager&gt;
      &lt;authentication-provider&gt;
          &lt;user-service&gt;
              &lt;user name="user1" password="12345" authorities="ROLE_USER" /&gt;
              &lt;user name="admin1" password="12345" authorities="ROLE_USER, ROLE_ADMIN" /&gt;
          &lt;/user-service&gt;
      &lt;/authentication-provider&gt;
  
  
  
      &lt;!-- authentication from database --&gt;
      &lt;authentication-provider&gt;
          &lt;jdbc-user-service data-source-ref="myDataSource"
              users-by-username-query="select username,password from [Simplehr].[dbo].[USERS] where username=?"
              authorities-by-username-query="Select username, concat('ROLE_',user_role) user_role from user_roles where username=?" /&gt;
      &lt;/authentication-provider&gt;
  
  &lt;/authentication-manager&gt;
  </code></pre>
  
  <p>But when I run the app, I see an error for a failed Login:</p>
  
  <blockquote>
    <p>PreparedStatementCallback; bad SQL grammar [select username,password
    from [Simplehr].[dbo].[USERS] where username=?]; nested exception is
    java.sql.SQLException: Invalid column index 3.</p>
  </blockquote>
  
  <p>But when I run the SQL statement in SQLserver it works.</p>