连接不上本地数据库?
我在公司连接服务器的SQLServer可以连上!用我在公司的机子连本地的数据库也连不上!我用我的电脑连本地也连不上 什么原因啊?
我用的是jbuilder
public void getConnection() {
try {
url = "jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=xxxxx";
driver = "com.microsoft.jdbc.sqlserver.SQLServerDriver";
username = "";
password = "";
Class.forName(driver);
cn = DriverManager.getConnection(url, username, password);
st = cn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);
}
catch (SQLException e) {
logg.log("连接数据库失败"+e.getMessage());
}
catch (ClassNotFoundException e) {
logg.log("数据库注册出毛病了!"+e.getMessage());
}
}
username password改了n次都没用 什么原因啊!我装的是 SQLServer个人版