当前位置: 技术问答>java相关
怎样通过Ip地址连接Sql server 数据库?
来源: 互联网 发布时间:2015-10-20
本文导语: 同上! | Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver"); String db_url="jdbc:microsoft:sqlserver://127.0.0.1:1433;DatabaseName=oa"; Connection sqlConn= DriverManager.getConnection(db_url,"sa",""); Statement sqlStmt=sql...
同上!
|
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
String db_url="jdbc:microsoft:sqlserver://127.0.0.1:1433;DatabaseName=oa";
Connection sqlConn= DriverManager.getConnection(db_url,"sa","");
Statement sqlStmt=sqlConn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);
String db_url="jdbc:microsoft:sqlserver://127.0.0.1:1433;DatabaseName=oa";
Connection sqlConn= DriverManager.getConnection(db_url,"sa","");
Statement sqlStmt=sqlConn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);