RT,try {
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
System.out.println("加载:com.microsoft.sqlserver.jdbc.SQLServerDriver");
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
Connection conn = null;
Statement st = null;
ResultSet rs = null;
try {
System.out.println("获取连接...");
conn = DriverManager.getConnection("jdbc:sqlserver://localhost:1533;databaseName=master", "sa", "123");
System.out.println("连接获取完毕");
st = conn.createStatement();
System.out.println("st");
rs = st.executeQuery("select id from test");
System.out.println(rs);
while(rs.next()){
System.out.println(rs.getString("id"));
}
} catch (SQLException e) {
e.printStackTrace();
}finally{
try {
rs.close();
st.close();
conn.close();
} catch (SQLException e) {
e.printStackTrace();
}
}
 }
输出:加载:com.microsoft.sqlserver.jdbc.SQLServerDriver
获取连接...
SA的密码没错,可以从management studio用SQL Server身份验证登录
求解~