コード例 #1
0
  public List<CheckInfo> get() {
    List<CheckInfo> list = new ArrayList<CheckInfo>();
    Statement stmt = null;
    String sql = "select * from spider_check where cType <> 5 order by sid ";
    ResultSet rs = null;
    try {
      stmt = daoHelp.getConnection().createStatement();
      rs = stmt.executeQuery(sql);
      while (rs.next()) {
        CheckInfo checkInfo = new CheckInfo();
        checkInfo.setSid(rs.getString(1));
        checkInfo.setPid(rs.getString(2));
        checkInfo.setField(rs.getString(3));
        checkInfo.setUrl(rs.getString(4));
        checkInfo.setCType(rs.getInt(5));
        checkInfo.setSite(rs.getString(6));
        checkInfo.setSType(rs.getString(7));
        checkInfo.setContent(rs.getString(8));
        list.add(checkInfo);
      }
      daoHelp.safeClose(rs);
      daoHelp.safeClose(stmt);
    } catch (SQLException e) {
      log.error("SQLException -> ", e);
      daoHelp.safeClose(rs);
      daoHelp.safeClose(stmt);
    } finally {
      daoHelp.safeClose(rs);
      daoHelp.safeClose(stmt);
    }

    return list;
  }