当前位置: 代码迷 >> Eclipse >> eclipse怎么配饰sql server2000 的桥联,请各位学长指教
  详细解决方案

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

热度:270   发布时间:2016-04-23 14:46:47.0
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();
}

------解决方案--------------------
有驱动干嘛不用呀!
有些时候,不要自己给自己找麻烦!
  相关解决方案