This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
The moose likes JDBC and Relational Databases and the fly likes Connection Pool Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Connection Pool" Watch "Connection Pool" New topic

Connection Pool

wasif akbar

Joined: May 02, 2001
Posts: 11
I am currently working on an application that requires the creation of a Database Connection Pool class. The problem is that I haven't created such a class before and I can't seem to find any sound documentation outlining guidelines on what is required or used to create a connection pool. Could you guys either provide a sample class or point to some documentation that would help out.
Thanks in advance,
Wasif Akbar
Praveen Balaji
Ranch Hand

Joined: Jun 17, 2001
Posts: 60
contact me off line :
i wrote a small conection pooling class for myself. This one supports multiple drivers and multiple database connecitons.
David O'Meara

Joined: Mar 06, 2001
Posts: 13459

or you could do a search...
I'm pretty sure Javaworld has an article on Object pooling.
Praveen Balaji
Ranch Hand

Joined: Jun 17, 2001
Posts: 60
Yeah.. it's pretty much object pooling.. except if you want something special done!!
for example, I have a cleaner thread that runs and cleans the connection pool at regular intervals. Such things!!
Peter den Haan
Ranch Hand

Joined: Apr 20, 2000
Posts: 3252
With all due respect, few home-grown connection pools are worth the disk space they occupy, and building your own connection pool is just about as useful as trying to patent a circular device facilitating horizontal transport of goods and persons (unless you're Australian, that is). (Praveen, I'm not implying anything specific about your pool, as I don't know it).
Try the Struts GenericDataSource class. A robust connection pool that turns any old JDBC driver into an industry-standard DataSource, so that you can simply replace it by a "native" DataSource if you get a driver or deploy in an environment that has one available, now that makes solid sense. Proprietary pools don't. Much less writing your own proprietary pool.
- Peter
[This message has been edited by Peter den Haan (edited November 02, 2001).]
I agree. Here's the link:
subject: Connection Pool
jQuery in Action, 3rd edition