• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Connection Pooling

 
CM Saritha
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

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

Thanks.
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Saritha",
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

thanks,
Dave
 
Prabhu Venkatachalam
Ranch Hand
Posts: 502
Java jQuery Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic