File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes What is connection pooling?and why would one go for it Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "What is connection pooling?and why would one go for it" Watch "What is connection pooling?and why would one go for it" New topic
Author

What is connection pooling?and why would one go for it

Ashutosh Limaye
Ranch Hand

Joined: Oct 24, 2005
Posts: 58
I have doubt regarding Connection pooling,
I'm unable to visualize a scenario where one
would pool connections...
Please if someone would be kind and explain me that,
I would be utterly grateful.
Kj Reddy
Ranch Hand

Joined: Sep 20, 2003
Posts: 1704
Have a look at:

http://java.sun.com/developer/onlineTraining/Programming/JDCBook/conpool.html
Ashutosh Limaye
Ranch Hand

Joined: Oct 24, 2005
Posts: 58
Thank you Mr KJ Reddy that was quite helpful.
Now one more query...

If i'm concurrently accessing two or more databases there is no doubt that i will require more than one connection.
But suppose I'm going to access the databases one after another is there any way in which I can just make the existing connection refrence point to the new database?
Is this a valid query in the first place...?!! I am in a doubt...
Kj Reddy
Ranch Hand

Joined: Sep 20, 2003
Posts: 1704
Ashutosh, Connection is a gateway to talk with a database. So if you are databases are same you can use same connection(that is the place Connection Pooling) concept derived. If databases are different you need to have different connections you can not use same connection.
Ashutosh Limaye
Ranch Hand

Joined: Oct 24, 2005
Posts: 58
Hmmm...
So we can use same statement reference to query different tables in a connection but if database vendor changes the connection changes...
I'm getting it?
Kj Reddy
Ranch Hand

Joined: Sep 20, 2003
Posts: 1704
You are smart and learn quickly
Hemanth Pallavajula
Ranch Hand

Joined: Oct 07, 2004
Posts: 38
Hi,

Before we come to conclusion, we need to take care of this point.:

As part of BEA Weblogic, we have the concept of MultiPool. Here, we can have connection pools of seperate DBs. The BEA definition goes like this:
A MultiPool is a pool of connection pools. All the connections in a particular connection pool are created identically with a single database, single user, and the same connection attributes; that is, they are attached to a single database. However, the connection pools within a MultiPool may be associated with different users or DBMSs.


But I am not sure of other Application Servers.


Cheers,<br />Hemanth...<br />(When opportunity doesn't knock, build a door.)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: What is connection pooling?and why would one go for it