Package org.worldbank.transport.tamt.shared

Examples of org.worldbank.transport.tamt.shared.TripStatisticsReport


   
  }

  public TripStatisticsReport getSoakBinReport() throws Exception {
   
    TripStatisticsReport report = new TripStatisticsReport();
    ArrayList<ArrayList> rows = new ArrayList<ArrayList>();
   
    try {
      Connection connection = getConnection();
      Statement s = connection.createStatement();
     
      String sql = "SELECT t.* FROM soakbin t, studyregion s WHERE s.iscurrentregion = true AND s.id = t.regionid ORDER BY t.binnumber";     
      logger.debug("SQL for getSoakBinReport: " + sql);
     
      ResultSet r = s.executeQuery(sql);
     
      while (r.next()) {
       
        ArrayList<String> row = new ArrayList<String>();
       
        // skip first row (regionid)
        row.add(r.getString(2)); // binnumber
        row.add(r.getString(3)); // bincount
       
        rows.add(row);
       
      }

      report.setReportValues(rows);
      logger.debug("getSoakBinReport DAO complete");
      return report;
   
    } catch (SQLException e) {
      logger.error(e.getMessage());
View Full Code Here


    }   
  }

  public TripStatisticsReport getTripStatisticsReport() throws Exception {
   
    TripStatisticsReport report = new TripStatisticsReport();
    ArrayList<ArrayList> rows = new ArrayList<ArrayList>();
   
    try {
      Connection connection = getConnection();
      Statement s = connection.createStatement();
     
      String sql = "SELECT t.* FROM tripbin t, studyregion s WHERE s.iscurrentregion = true AND s.id = t.regionid ORDER BY t.binnumber";     
      logger.debug("SQL for getTripStatisticsReport: " + sql);
     
      ResultSet r = s.executeQuery(sql);
     
      while (r.next()) {
       
        ArrayList<String> row = new ArrayList<String>();
       
        // skip first row (regionid)
        row.add(r.getString(2)); // binnumber
        row.add(r.getString(3)); // bincount
        row.add(r.getString(4)); // avgtriplength
        row.add(r.getString(5)); // avgspeed
       
        rows.add(row);
       
      }

      report.setReportValues(rows);
      logger.debug("getTripStatisticsReport DAO complete");
      return report;
   
    } catch (SQLException e) {
      logger.error(e.getMessage());
View Full Code Here

    dao.createTripStatisticsReport();
  }

  public TripStatisticsReport getSoakBinReport() throws Exception {
   
    TripStatisticsReport report = dao.getSoakBinReport();
    //TODO: add missing rows (so that we have all bin numbers from 0..9)
    return report;
  }
View Full Code Here

    return report;
  }
 
  public TripStatisticsReport getTripStatisticsReport() throws Exception {
   
    TripStatisticsReport report = dao.getTripStatisticsReport();
    //TODO: add missing rows (so that we have all bin numbers from 0..9)
    return report;
  }
View Full Code Here

TOP

Related Classes of org.worldbank.transport.tamt.shared.TripStatisticsReport

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.