}
}
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());