title: What pooled data source should I use for Spring 3.1.0, Hibernate 4.0.1.Final, and MySQL 5.1?
body: <p>I'm using Spring 3.1.0.RELEASE, Hibernate 4.0.1.Final, and MySQL 5.1.  What is the pooled data source I should be using?  I'm currently using (snippet from application context file) ...</p>
  
  <pre><code>&lt;bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"&gt;
      &lt;property name="driverClassName"&gt;
          &lt;value&gt;com.mysql.jdbc.Driver&lt;/value&gt;
      &lt;/property&gt;
      &lt;property name="url"&gt;
          &lt;value&gt;jdbc:mysql://localhost:3306/myproj&lt;/value&gt;
      &lt;/property&gt;
      &lt;property name="username"&gt;
          &lt;value&gt;myproj&lt;/value&gt;
      &lt;/property&gt;
      &lt;property name="password"&gt;
          &lt;value&gt;password&lt;/value&gt;
      &lt;/property&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>but this isn't a pooled data source, creating JDBC connections on each call.  I used to have this Hibernate config (hibernate.cfg.xml) ...</p>
  
  <pre><code>&lt;hibernate-configuration&gt;
  &lt;session-factory&gt;
      &lt;property name="hibernate.connection.driver_class"&gt;com.mysql.jdbc.Driver&lt;/property&gt;
      &lt;property name="hibernate.connection.url"&gt;jdbc:mysql://localhost:3306/myproj&lt;/property&gt;
      &lt;property name="hibernate.connection.username"&gt;myproj&lt;/property&gt;
      &lt;property name="hibernate.connection.password"&gt;password&lt;/property&gt;
      &lt;property name="hibernate.connection.pool_size"&gt;10&lt;/property&gt;
      &lt;property name="show_sql"&gt;true&lt;/property&gt;
      &lt;property name="dialect"&gt;org.hibernate.dialect.MySQLDialect&lt;/property&gt;
      ...
  </code></pre>
  
  <p>but because of a bug in Spring 3.1.0, I can't use a hibernate.cfg.xml file when configuring my session factory bean (which I tried to do like this -- snippet from the spring application context file ...)</p>
  
  <pre><code>&lt;bean class="org.springframework.orm.hibernate4.LocalSessionFactoryBean" id="sessionFactory"&gt;
      &lt;property name="configLocation"&gt; 
          &lt;value&gt;classpath:hibernate.cfg.xml&lt;/value&gt; 
      &lt;/property&gt;
  </code></pre>