wood burning stoves 2.0*
The moose likes JDBC and the fly likes Connection Pooling Question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Connection Pooling Question" Watch "Connection Pooling Question" New topic
Author

Connection Pooling Question

Claude Cundiff
Ranch Hand

Joined: Mar 20, 2008
Posts: 78
Hello everyone,

I understand the high level concept of connection pooling. What I'm trying to get is a more detailed understanding. In particular, suppose I were to write my own connection pool (in Java of course;) ) . I understand the notion of caching the connections. What i'm not getting is this:

If I have code that calls the connection pooling object or objects, then won't all those connections be created at the time the Connection Pool object is being created (assuming it does this when the constructor runs).

I would think you would have to have a Connection pooling "Server" situation where the Connection pool Object(s) are listening for a connection request. If this is the case, when speaking of creating a connection pool, am I really talking about implementing a special kind of server?

I hope that makes sense.

Thanks!
Prabhakar Reddy Bokka
Ranch Hand

Joined: Jul 26, 2005
Posts: 189

Creating your own connection pool can be done with the "Object Pooling" technique.

You have to pool your connection objects. Thats it.


SCJP 5, SCWCD 5
vijin das
Ranch Hand

Joined: Jun 07, 2010
Posts: 129

....Y Don't go for DBCP from Apache.............
Just Download the API and try to reverse engineer it ....
and doing so is not bad... but ..remember about licenses....


VIJINDAS
Jan Cumps
Bartender

Joined: Dec 20, 2006
Posts: 2497
    
    8

vijin das wrote:....Y Don't go for DBCP from Apache.............
Just Download the API and try to reverse engineer it ....
and doing so is not bad... but ..remember about licenses....
The source code is available. Apache DBCP is Open Source. You don't need to reverse engineer.


OCUP UML fundamental and ITIL foundation
youtube channel
 
wood burning stoves
 
subject: Connection Pooling Question