[讨论]怎么这样也会有异常的
Connection con=null;Statement stmt;
ResultSet rs;
try
{
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
con = DriverManager.getConnection("jdbc:microsoft:sqlserver://localhost:1433;databaseName=NM","sa","jan");
stmt = con.createStatement();
}catch(Exception ex){System.out.println("Erro:::"+ex);}
/**
*exception: java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Error establishing *socket.
*/
----------------解决方案--------------------------------------------------------
为SQL打一下补丁吧
----------------解决方案--------------------------------------------------------
先看看是不是大小写有问题,然后检查SQL是否升到SP4了!!
----------------解决方案--------------------------------------------------------
SQL打上SP4的补丁。
----------------解决方案--------------------------------------------------------