title: How do you configure a DataSource in Spring?
body: <p>I am studying for Spring Core certification and I have some doubt about how correctly answer to this question:</p>
  
  <blockquote>
    <p>How do you configure a DataSource in Spring? Which bean is very useful
    for development?</p>
  </blockquote>
  
  <p>I think that I do something like this to configure <strong>DataSource</strong> in a Spring XML configuration file:</p>
  
  <pre><code>&lt;bean id=“dataSource” class=“org.apache.commons.dbcp.BasicDataSource”&gt;
      &lt;property name=“url” value=“${dataSource.url}” /&gt;
      &lt;property name=“username” value=“${dataSource.username}” /&gt;
      &lt;property name=“password” value=“${dataSource.password}” /&gt;
  &lt;/bean&gt;
  
  &lt;jdbc:initialize-database data-source=“dataSource”&gt;
      &lt;jdbc:script location=“classpath:schema.sql” /&gt;
      &lt;jdbc:script location=“classpath:test-data.sql” /&gt;
  &lt;/jdbc:initialize-database&gt;
  </code></pre>
  
  <p>So I think that the answered bean is the <strong>org.apache.commons.dbcp.BasicDataSource</strong>. Is this assertion true or am I missing something?</p>
  
  <p>What exactly represent the declared <strong></strong> configuration tag? It is clear for me what it do but what exactly represent? Is it a special bean declaration or what?</p>
  
  <p>Tnx</p>