This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
Some operations are verrrryyyy slow. Database connections are the usual culprit. Consider an application where you have a buch of short database operation scattered through your application, like 'check user exists', 'get user groups', 'load preferences', 'update list of things', 'check other list for updates' and about a hundred more.
You would find that the cost of opening and closing database connections took significantly more time than the actual operations. You may consider solutions like using a single connection in yourr application, or maintaining a connection for a user, but these solutions, while sounding useful, have serious problems of their own.
The solution is to get an intermediate layer to open a bunch of connections and share them with anyone who wants to use them. Database connections are nice since you can almost always reuse them. Connection Pools, a specific type of Resource Broker, can also manage a bunch of other things under the covers for you so you don't have to worry about them.
But enough about Connection Pooling in the servlets forum, I'll move this thread to the JDBC forum for you.
Dave
Rajendra Pachouri
Greenhorn
Joined: Sep 16, 2005
Posts: 10
posted
0
JDBC connection pooling related with the performace of server and your webapplication that why we use the connection pooling . Actualy in connection pooling we gave connecton to database with server and to application we gave refrence of server . So same connection can be give in no.of application so performace increase.
123
Maki Jav
Ranch Hand
Joined: May 09, 2002
Posts: 423
posted
0
David have explained it very well.
My friends and I have a connection pooling class of our beloved teacher mr. waheed from our java learning days that we love to use. I can post it if I am allowed.
Maki, In general, the question of posting other people's code depends on two criteria: 1) Did you give them credit? - This you already did. 2) Is the other person ok with it? - Not sure if how the original author would feel on this one.
In any case, the Conmmon's link Ben provided is very good. I highly recommend that over a custom implementation.