The moose likes JDBC and Relational Databases and the fly likes Connection Pooling 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" Watch "Connection Pooling" New topic

Connection Pooling

CM Saritha

Joined: Nov 23, 2006
Posts: 2

How can we make connection pooling using core Java.
Can any one please give me a solution...

David O'Meara

Joined: Mar 06, 2001
Posts: 13459

Welcome to the JavaRanch.

We're a friendly group, but we do require members to have valid display names.

Display names must be two words: your first name, a space, then your last name. Fictitious names are not allowed.

Please edit your profile and correct your display name since accounts with invalid display names get deleted, often without warning

Prabhu Venkatachalam
Ranch Hand

Joined: Nov 16, 2005
Posts: 502

There is aready a open source utils for creating Db pooling. Have a look at this URL.

However, if you want to create one your own,

Create a set of connection using JDBC and store it using some collection classes. whenever new connection is requested, use it from the existing one. This will reduce connection creation time.

Prabhu Venkatachalam<br />SCJP 1.4,SCWCD 1.4<br />
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42965
Word of advice: Use an existing library instead of trying to create your own. There are a number of issue that can introduce hard-to-find bugs that you need to deal with, like synchronization of threads and proper handling of transactions, that it'd save you time to go with a ready-made solution.
I agree. Here's the link:
subject: Connection Pooling
It's not a secret anymore!