title: spring security login not working with oracle
body: <p>I am working on spring security login using jdbc-user-service. It is working on Mysql but not on oracle. I am using oracle 11 XE.</p>
  
  <p>The queries I have mentioned in  tag are correct because those return expected rows when I run those on oracle console.</p>
  
  <p>The datasource is :</p>
  
  <pre><code>&lt;bean id="dataSource"
      class="org.springframework.jdbc.datasource.DriverManagerDataSource"&gt;
      &lt;property name="driverClassName" value="${jdbc.driver}" /&gt;
      &lt;property name="url" value="${datasource.url}" /&gt;
      &lt;property name="username" value="${jdbc.user}" /&gt;
      &lt;property name="password" value="${jdbc.password}" /&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>in sessionFactory bean hibernate dialect for oracle is given.</p>
  
  <pre><code>&lt;prop key="hibernate.dialect"&gt;org.hibernate.dialect.Oracle10gDialect&lt;/prop&gt;
  </code></pre>
  
  <p>Same code works for mysql and not on oracle. The application control is redirected to login page which I have set in spring security file. This means it is getting username &amp; password correctly.</p>
  
  <pre><code>&lt;form-login login-page="/landing" default-target-url="/home"
          authentication-failure-url="/landing?msg=cw" /&gt;
  </code></pre>
  
  <p>The authentication provider code in spring security xml is :</p>
  
  <pre><code>&lt;authentication-manager&gt;
      &lt;authentication-provider&gt;
      &lt;jdbc-user-service data-source-ref="dataSource"
              users-by-username-query=" 
      select USERNAME as username, PASSWORD as password,'true' as enabled from 
      users where USERNAME=?"
  
              authorities-by-username-query=" select u.USERNAME 
      as username, r.ROLE as authority from users u, roles r, user_roles 
      ur where u.USER_ID = ur.USER_ID and ur.ROLE_ID = r.id and u.USER_ID = (SELECT 
      USER_ID from users where USERNAME = ?)" /&gt;
  
      &lt;/authentication-provider&gt;
  &lt;/authentication-manager&gt;
  </code></pre>
  
  <p>Is there anything need to be configured in order to use oracle in spring security ?</p>
  
  <p>UPDATE : I set spring security debug and this is what is printing after I try to login.</p>
  
  <pre><code>INFO : Spring Security Debugger - 
  
  ************************************************************
  
  Request received for '/j_spring_security_check':
  
  org.apache.catalina.connector.RequestFacade@7262b6
  
  servletPath:/j_spring_security_check
  pathInfo:null
  
    Security filter chain: [
    ConcurrentSessionFilter
    SecurityContextPersistenceFilter
    LogoutFilter
    UsernamePasswordAuthenticationFilter
    BasicAuthenticationFilter
    RequestCacheAwareFilter
    SecurityContextHolderAwareRequestFilter
    AnonymousAuthenticationFilter
    SessionManagementFilter
    ExceptionTranslationFilter
    FilterSecurityInterceptor
  ]
  
  
  ************************************************************
  
  
  INFO : Spring Security Debugger - 
  
  ************************************************************
  
  Request received for '/landing?msg=cw':
  
  org.apache.catalina.connector.RequestFacade@bf1a4a
  
  servletPath:/landing
  pathInfo:null
  
  Security filter chain: [
  ConcurrentSessionFilter
  SecurityContextPersistenceFilter
  LogoutFilter
  UsernamePasswordAuthenticationFilter
  BasicAuthenticationFilter
  RequestCacheAwareFilter
  SecurityContextHolderAwareRequestFilter
  AnonymousAuthenticationFilter
  SessionManagementFilter
  ExceptionTranslationFilter
  FilterSecurityInterceptor
  ]
  
  
  ************************************************************
  </code></pre>