I\'m using Spring and struts and have the following entry in \'/META-INF/context.xml\'
For Tomcat, you can setup a connection pool in the server's server.xml file, that way the username/password is outside of your war file. Here's some info on how Context elements behave in Tomcat 5.5 http://tomcat.apache.org/tomcat-5.5-doc/config/context.html
Alternately, you can use the standalone DBCP package from Apache from your Spring config file, and use the jdbc.properties to replace your username/password in there. For example:
com.microsoft.sqlserver.jdbc.SQLServerDriver
${jdbc.url}
${jdbc.username}
${jdbc.password}
30
100
10000