Can anybody provide examples or links on how to establish a JDBC connection pool?
From searching google I see many different ways of doing this and it is rather confusing.
Ultimately I need the code to return a java.sql.Connection
object, but I am having trouble getting started..any suggestions welcome.
Update: Doesn't javax.sql
or java.sql
have pooled connection implementations? Why wouldn't it be best to use these?
Update 2: I ended up using Commons DBCP to accomplish the pooling. I used something similar to the code sample suggested by Eric Hauser (see his response below). Can somebody confirm that this actually creates and uses a pool behind the scenes?