You can only get the official driver direct from Microsoft (this link gives direct access without having to go through the #$@!ing .NET/Passport login). Note that Microsoft loves to rearrange their site every few weeks, so if the above link doesn't work, search their site for “JDBC.”
DO NOT DOWNLOAD Setup.exe. Get the .tar instead, because you have no idea what the .exe installs or where. Winzip recognizes .tar files, so you can use it to extract only the following three files:
- mssqlserver.jar,
- msbase.jar, and
- msutil.jar
Tomcat
To set up tomcat, save the aforementioned jars in the common/lib and add the following to conf/server.xml (the items to change are CAPITALIZED):
<Context path="/RELATIVE-PATH-TO-APP" docBase="?SOMETHING?"> <Resource name="jdbc/?SOMETHINGELSE?" scope="Shareable" type="javax.sql.DataSource"/> <ResourceParams name="jdbc/?UHH...?"> <parameter> <name>factory</name> <value>org.apache.commons.dbcp.BasicDataSourceFactory</value> </parameter> <!-- DBCP database connection settings --> <parameter> <name>url</name> <value>jdbc:microsoft:sqlserver://SERVERNAME:1433;DatabaseName=DBNAME[;SelectMethod=cursor]</value> </parameter> <parameter> <name>driverClassName</name> <value>com.microsoft.jdbc.sqlserver.SQLServerDriver</value> </parameter> <parameter> <name>username</name> <value>USERNAME</value> </parameter> <parameter> <name>password</name> <value>PASSWORD</value> </parameter> <!-- DBCP connection pooling options --> <parameter> <name>maxWait</name> <value>5000</value> </parameter> <parameter> <name>maxIdle</name> <value>2</value> </parameter> <parameter> <name>maxActive</name> <value>4</value> </parameter> </ResourceParams> </Context>