首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Eclipse开发 >

eclipse怎么配饰sql server2000 的桥联,请各位学长指教

2011-12-13 
eclipse如何配饰sql server2000 的桥联,请各位学长指教最好能把详细的cfg.xml文件贴出来,谢谢:)[解决办法]

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();
}

[解决办法]
有驱动干嘛不用呀!
有些时候,不要自己给自己找麻烦!

热点排行