This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
The best practice for connecting to a JDBC DataSource in a Struts or any J2EE Web Application is to define the DataSource as a JNDI resource using your Application Server's preferred method and then using JNDI to look up the DataSource in your application code. If you're using Tomcat, this link explains how to do it.
Also see question 7 in the JavaRanch Struts FAQ
Joined: Nov 16, 2006
Hello sir, Thank you for your reply but sir there was no hyperlink which you referred there
Joined: Jan 09, 2005
If you're using Tomcat, this link explains how to do it.