*
The moose likes JDBC 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
Bookmark "Connection pooling package" Watch "Connection pooling package" New topic
Author

Connection pooling package

Rohit Prasad
Greenhorn

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
internet detective
Marshal

Joined: May 26, 2003
Posts: 30299
    
150

Rohit,
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.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Rohit Prasad
Greenhorn

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?

Thanks

Rohit
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

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
Greenhorn

Joined: Sep 05, 2006
Posts: 12
Thanks.

Rohit
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Connection pooling package