I am trying to connect to my SQL Server 2008 database from Java and I\'m having the same problem from this thread.
String userName = \"xxxx\";
String password =
You dont need both jTDS and JDBC in your classpath. Any one is required. Here you need only sqljdbc.jar
.
Also, I would suggest to place sqljdbc.jar
at physical location to /WEB-INF/lib
directory of your project rather than adding it in the Classpath via IDE. Then Tomcat takes care the rest. And also try restarting Tomcat.
You can download Jar from : www.java2s.com/Code/JarDownload/sqlserverjdbc/sqlserverjdbc.jar.zip
EDIT:
As you are supplying Username and Password when connecting,
You need only jdbc:sqlserver://localhost:1433;databaseName=test
, Skip integratedSecurity
attribute.