I\'ve tried just about everything I can find out there, if someone is able to help me out, I will be eternally grateful (and a lot more free in my time).
Basically,
The context.xml
in your web application's META-INF
folder will take precedence over the one in the /conf directory, which is really just a generic default.
The open-source JTDS SQL Server driver is way better than Microsoft's. Unless there's an overriding reason, use it instead. The only reason to put it in your tomcat/lib folder is if you're declaring a GlobalNamingResource for the database in your server.xml, otherwise you can just put it in your application's /lib folder.
The JDBC URL for JTDS is: jdbc:jtds:sqlserver://hostname/databasename
The connection driver class for JTDS is: net.sourceforge.jtds.jdbc.Driver
In tomcat 6.0.36 it's exactly the opposite way:
CATALINA_HOME/conf/Catalina/your_host/context.xml
will take presedence over the one from
YourApplication/WebContent/META-INF/
After putting data following snippet inside the Context-Tag in Catalina/your_host
it worked in my case:
<WatchedResource>WEB-INF/web.xml</WatchedResource>
<Resource name="jdbc/your_db" auth="Container" type="javax.sql.DataSource"
maxActive="50" maxIdle="30" maxWait="10000"
username="your_usr" password="your_pwd"
driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://your_host:3306/your_db"/>
See Tomcat Documentation on http://tomcat.apache.org/tomcat-6.0-doc/config/context.html