Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Connection pooling

 
Ranch Hand
Posts: 159
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 1209
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
WHAT is your favorite color? Blue, no yellow, ahhhhhhh! Tiny ad:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic