连接MS SQL时出现问题,请教.
public class Application1 {
public static void main(String[] args) {
try{
String user="sa";
String password="";
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
Connection conn=DriverManager.getConnection("jdbc:microsoft:sqlserver://JENKIY-18U65L2T:1433;DatabaseName=Northwind",user,password);
System.out.println("good");
}
catch(Exception e)
{System.out.println(e); }
}
}
一运行就出现:
java.sql.SQLException: [Microsoft][SQLServer JDBC Driver]Error establishing socket.