Chinaunix首页 | 论坛 | 博客
  • 博客访问: 411350
  • 博文数量: 101
  • 博客积分: 2324
  • 博客等级: 大尉
  • 技术积分: 887
  • 用 户 组: 普通用户
  • 注册时间: 2010-11-19 19:28
文章分类

全部博文(101)

文章存档

2012年(3)

2011年(60)

2010年(38)

分类: Java

2011-03-21 14:36:06

try
        {
            Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver").newInstance();
            Connection con = DriverManager.getConnection
                            ("jdbc:sqlserver://localhost:1433;DatabaseName=XXX","sa","XXX");
                            
                            
                            Statement stmt = con.createStatement();
                            ResultSet rst = stmt.executeQuery("select * from XXXX");
                            out.println("

");
                            while(rst.next())
                                {
                                
                                    out.println("
");
                                    out.println("
");
                                    out.println("
");
                                    out.println("
");
                                    out.println("
");
                                    out.println("
");
                                    out.println("
");
                                    out.println("
");
                                
                                }
                            out.println("
XXXXSxXXXrXXXXChasis_Serial_Number
"+rst.getString("XX_Ip")+""+rst.getString("XX")+""+rst.getString("SW_XX")+""+rst.getString("x_X_x_x")+""+rst.getString("x_x_x_x")+""+rst.getString("x_x_x_x")+""+rst.getString("x_x_x")+"
");
                                rst.close();
                                stmt.close();
                                con.close();
        }
        catch(Exception e){
            e.printStackTrace();
        }


阅读(679) | 评论(0) | 转发(0) |
0

上一篇:关于一个snmp的具体程序-9k

下一篇:数组

给主人留下些什么吧!~~