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.
The moose likes Java in General and the fly likes Connection pooling Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "Connection pooling" Watch "Connection pooling" New topic
Author

Connection pooling

Cherry Mathew
Ranch Hand

Joined: Dec 26, 2000
Posts: 159
Hi,
I ned to do a database connection pooling in my project.
i need to develop the project for web environment and also as an application.
my first questuion is if i use a connection pool where will i get the connection in a sevlet in the init() method or the servic() method.
is it advicable to have it in the service method?
Will i get ready code for connection pooling and from where?
What are the issues i need to take care when developing the connection pool
Cherry
Frank Lin
Ranch Hand

Joined: Jan 26, 2001
Posts: 76
You should put it in the service() method in order to effectively use connection pool.
Check the servlet forum on Javaranch, you would find more info there.
Karthik Guru
Ranch Hand

Joined: Mar 06, 2001
Posts: 1209
you can probably check this out..sample connection pool code. http://www.webdevelopersjournal.com/columns/connection_pool.html
I w'd probably put it in the init() method.
I don't know why it s'd be initialised in the service().
init() w'd be called when u load the servlet through the web server. So i guess all initialisation can go there?
cheers,
karthik.
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Connection pooling
 
Similar Threads
Need some good connection pool
JDBC Connection Pooling
Connection Pooling Question
Connection Pooling in tomcat 6
Connection Pooling