JDBC的一点问题
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
DriverManager.getConnection("jdbc:microsoft:sqlserver://localhost:1433;DataBaseName=test");
为什么连接本地服务器的时候getConnection 都会抛出异常呢?(我的端口是1433,localhost,127.0.0.1等也都是过了,数据库名字也没错)而连接远成的另一个服务器就没有错误。
java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Error establishing socket.