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.
Why do not you use the connection pool provided by the container as Sunil mentioned? Or , if you want to go by this approach then it would be bettter to have a db.properties file within your application , which would have all the connection related parameters.
I've never used, or been aware of , a connection pool. I'll have to look into that.
Otherwise, besides less efficiency, are there any other setbacks to making them context parameters in terms of security perhaps?
Joined: Nov 29, 2005
I do not see and security threat to your approach as this (web.xml) would be within the WEB-INF directory.In fact I have worked on some application where some parameters are passed to the application using the init-param.