eclipse如何配饰sql server2000 的桥联,请各位学长指教
最好能把详细的cfg.xml文件贴出来,谢谢:)
[解决办法]
String driverName = "com.microsoft.jdbc.sqlserver.SQLServerDriver ";
String dbURL = "jdbc:sqlserver://172.20.121.165; DatabaseName=adv_jmdata ";
String userName = " ";
String userPwd = " ";
Connection dbConn;
try {
Class.forName(driverName);
dbConn = DriverManager.getConnection(dbURL, userName, userPwd);
Statement stmt=dbConn.createStatement();
ResultSet rs=stmt.executeQuery( "select ctr_id,name10 from adv_jmdata.dbo.mgtctr ");
String name;
String port;
while(rs.next())
{
name=rs.getString( "name10 ");
port=rs.getString( "ctr_id ");
System.out.println(port);
System.out.println(name);
}
System.out.println( "Connection Successful! ");
} catch (Exception e) {
e.printStackTrace();
}
[解决办法]
有驱动干嘛不用呀!
有些时候,不要自己给自己找麻烦!