title: Configuring the built-in c3p0 pooling in Hibernate using Spring
body: <p>I learned that to configure c3p0 pooling in hibernate, we can have write the configuration in hibernate.cfg.xml such this:</p>
  
  <pre><code>&lt;property name="hibernate.c3p0.min_size"&gt;2&lt;/property&gt;
      &lt;property name="hibernate.c3p0.max_size"&gt;5&lt;/property&gt;
      &lt;property name="hibernate.c3p0.timeout"&gt;600&lt;/property&gt;
      &lt;property name="hibernate.c3p0.max_statements"&gt;0&lt;/property&gt;
      &lt;property name="hibernate.c3p0.idle_test_period"&gt;300&lt;/property&gt;
      &lt;property name="hibernate.c3p0.acquire_increment"&gt;1&lt;/property&gt;
  </code></pre>
  
  <p>However I configured Hibernate using Spring. When I tried to do below, it wouldn't work:</p>
  
  <pre><code>&lt;bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"&gt;
      &lt;property name="driverClassName" value="com.mysql.jdbc.Driver" /&gt;
      &lt;property name="url" value="jdbc:mysql://localhost/news_loader" /&gt;
      &lt;property name="username" value="blah" /&gt;
      &lt;property name="password" value="blah" /&gt; 
  
      &lt;property name="hibernate.c3p0.min_size" value="2" /&gt;
      &lt;property name="hibernate.c3p0.max_size" value="5" /&gt;
      &lt;property name="hibernate.c3p0.timeout" value="600" /&gt;
      &lt;property name="hibernate.c3p0.max_statements" value="0" /&gt;
      &lt;property name="hibernate.c3p0.idle_test_period" value="300"/&gt;
      &lt;property name="hibernate.c3p0.acquire_increment" value="1" /&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>I've read about using the stand-alone c3p0 pooling which can be configured using Spring, but is there any way that I can configure the built-in c3p0 pooling in Hibernate using Spring?</p>
  
  <p>Enlighten me coz i'm a beginner.</p>