This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
When I run the startup script I would like to run a servlet that would set up a number of connections to a database. So when the web application is up and running I would already have stored a number of database connections in the servlet contex. Is this possible or can I only run a servlet when the web application is up and running. What I am trying to achieve is with the connections established when someone l;ogs in they dont have to wit for the servlet to connect to the database. Thanks for any help. Tony
You can use the init() method of the servlets to set this up. The init() is called when the web application is first loaded, so by the time a request is actually handled, everything can be ready to go -- nice and fast.