Zombies
Zombies

Reputation: 25872

Connection Pooling in Java SE?

It is hard to find a resource on this without finding Java EE, but here is what I am looking for:

All I have is a standard Java SE app, it makes a lot of DB connections. I simply need to make use of a connection pool. Any suggestions?

Upvotes: 3

Views: 3580

Answers (6)

Scott
Scott

Reputation: 17037

Take a look at HikariCP. Even BoneCP's author admits it is now the king of the hill.

Upvotes: 1

Yanamon
Yanamon

Reputation: 630

Here are two options that don't require any Java EE:

C3P0 - I have used this pool library for a long time in a Java SE app but it does not support the new Java 6 JDBC interfaces. You can still use the pool Java 6 but if you try and call any of the new methods an exception is thrown saying that the method is not implemented.

DBCP - I have never used this connection pool myself but I have seen various posts about it, and it does support the new JDBC features added in Java 6

Upvotes: 3

wwadge
wwadge

Reputation: 3544

Can I also suggest BoneCP (http://jolbox.com) ? It is currently the fastest connection pool available and offers a good feature set.

Upvotes: 3

user207421
user207421

Reputation: 310913

javax.sql.DataSource provides a connection pool, and most DB vendors provide an implementation of DataSource.

Upvotes: 2

ewernli
ewernli

Reputation: 38615

I would suggest c3p0. There is also this other question which discusses c3p0 vs DBCP and several stand-alone connection pools.

Upvotes: 5

Péter Török
Péter Török

Reputation: 116266

Here is a list of Java connection pool libraries. I have only used c3po out of these, as part of Hibernate, and so far it works fine (as much as I actually see of it... but I guess if I rarely ever notice the connection pooling software I am using, then it is working well ;-)

Upvotes: 1

Related Questions