[讨论]怎么这样也会有异常的
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.
*/