我想访问位于 ASUS\MSSQLSERVER1
上名为 "Test" 的 SQL 数据库,并使用用户名 teste 和密码 teste 进行访问。
在 Java 代码中,我编写了以下内容:
@Test
public void TesteTemp() throws SQLException, InstantiationException, IllegalAccessException, ClassNotFoundException
{
Class.forName("net.sourceforge.jtds.jdbc.Driver").newInstance();
String connString = "jdbc:jtds:sqlserver://ASUS/Test;instance=MSSQLSERVER1;user=teste;password=teste;";
Connection conn = null;
try{
conn = DriverManager.getConnection(connString);
}catch(SQLException ex){
ex.printStackTrace();
}
conn.close();
}
我收到了这个错误:
服务器 ASUS 没有名为 MSSQLSERVER1 的实例。
这有道理吗?
我已经运行了 MSSQLSERVER1 服务。