中国网络水泥 发表于 2018-12-6 14:19:58

Tomcat5+Mssql server 2000数据库连接池配置之旅

if (ds != null) {  Connection conn = ds.getConnection();
  if(conn != null){
  foo = "Got Connection "+conn.toString();
  Statement stmt = conn.createStatement();
  ResultSet rst =
  stmt.executeQuery("select * from orders");
  if(rst.next()) {
  foo=rst.getString("CustomerID");
  bar=rst.getInt("OrderID");
  }
  conn.close();
  }
  }
  }catch(Exception e) {
  e.printStackTrace();
  }
  }

页: [1]
查看完整版本: Tomcat5+Mssql server 2000数据库连接池配置之旅