第1个回答 2015-05-23
自己不能安装sqlserver,但可以访问网络上其他windows的sqlserver,比如:
try
{ //加载驱动程序
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
String connectionUrl = "jdbc:sqlserver://192.168.1.199;database=data;user=sa;password=***";
//创建连接
Connection con = DriverManager.getConnection(connectionUrl);
}
catch(ClassNotFoundException e)
{
System.out.println("加载驱动程序出错");
}
catch(SQLException e)
{
System.out.println(e.getMessage());
}
catch(Exception e)
{
System.out.println("出现了好大的错误");
}本回答被提问者和网友采纳