title: Oracle DB Connectivity issue with Java Spring Bean
body: <p>Actually I am trying to call queryForInt() method but it displays NULL exception. When I acces the dB with same credential using Following Code:</p>
  
  <p>----------------This is Working-----------------------</p>
  
  <pre><code>DriverManagerDataSource dataSource = new DriverManagerDataSource();
  dataSource.setDriverClassName("oracle.jdbc.driver.OracleDriver");
  dataSource.setUrl("jdbc:oracle:thin:@localhost:1521:xe");
  dataSource.setUsername("userName");
  dataSource.setPassword("pwd");
  </code></pre>
  
  <p>------ In Bean -----------------(This is not working)
      
      
          
          
          
      </p>
  
  <pre><code>&lt;!-- DAOS --&gt;
  &lt;bean id="ProductDAO" class="br.edeploy.voive.dao.ProductDAO"&gt;
      &lt;property name="dataSource" ref="dataSource"/&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>---------On ProductDAO Class --------------(Exception is thrown here when I use Spring method)</p>
  
  <pre><code>try
  {
    int i = getSimpleJdbcTemplate().queryForInt("Select * from ERP_PRODUCT", "");
  }
  catch(DataAccessException dax)
  {
    throw new Exception("Error: "+dax.getMessage());
  }
  </code></pre>
  
  <p>Thanks.</p>