File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes Connection pooling package Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Connection pooling package" Watch "Connection pooling package" New topic

Connection pooling package

Rohit Prasad

Joined: Sep 05, 2006
Posts: 12
I am writing a small application using struts. I plan to use Data Access Object (DAO) pattern for my Model. I am connfused if I should use application server specific conection pooling or some external packages. If I use app server specific than how much code I need to re write if I move to another app server? I know it depends on how I design the code - Is there any place where I can read more about it? What about using external packages? any opensource available for free?

Thanks in advance for everyones help.

Rohit Prasad
Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 33098

You should definitely not write your own connection pooling package.

If you are using an application server like JBoss or WebSphere, the datasource already provides you one for free. If not, dbcp is a common one.

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
Rohit Prasad

Joined: Sep 05, 2006
Posts: 12
Thanks Jeanne for your response. I do not plan to write my own connection pooling package. Currently I am working with WSAD that comes with WS 5.1 Test environment. If I use connection pooling provided by WS and down the road decided to move to another App Server say Apache, do I need to write the code again to use Apache Connection pooling?

What is the difference between using app server connection pooling vs. external package?


Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15302

Connection pooling provided by an app server will generally give you access to said data source via JNDI so your code shouldn't need to change at all with the exception of the JNDI name, which should probably be in a config file of some sort anyway.

GenRocket - Experts at Building Test Data
Rohit Prasad

Joined: Sep 05, 2006
Posts: 12

I agree. Here's the link:
subject: Connection pooling package
It's not a secret anymore!