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 are looking at sqljdbc4.2 version like :
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
but, for sqljdbc4 version statement should be:
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
I think if you change your first version to write the correct Class.forName , your application will run.