I trying to test the connection with my local sql DB. I have this code:
try{
Class.forName(\"com.microsoft.sqlserver.jdbc.SQLServerDriver\").newInstance(
Having been through this very recently the steps I took to solve pretty much the same problem were
The absolute kicker for me was understanding what IP addresses and ports the instance was set to listen on so that when I constructed the connection string the connection wasn't being rejected.
Also, if you want to connect using Windows logins you need to ensure the SQL instance is configured for mixed mode authentication (i.e. to allow Windows and SQL logins)