Skip to content

I’ve just come across this tip over on listing JDBC drivers and their connection strings for many different database vendors.

It may come in handy someday so I’ve bookmarked it here.

I was surprised though that it doesn’t contain details of the jTDS driver for SQL Server.

Recently I wanted to add a connection pool to my Spring Web Application. I decided to use Commons DBCP to provide the connection pool as I’m using the Spring JDBC wrapper classes. Googling around didn’t find any examples of how to set up DBCP, so I’ve written my findings here.

Adding a connection pool to a Spring app is simply a matter of specifying the relevant entries in the Spring servlet configuration file. The XML snippet below shows an example of how a database connection pool can easily be configured.

<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
  <property name="driverClassName">

  <property name="url">
  <property name="username">

  <property name="password">
  <property name="initialSize">

  <property name="maxActive">

  <property name="maxIdle">