return trafficCountReport;
}
public TrafficCountRecord getTrafficCountRecordById(String id) throws Exception {
TrafficCountRecord trafficCountRecord = new TrafficCountRecord();
try {
Connection connection = getConnection();
Statement s = connection.createStatement();
String sql = "select id, tag, countdate, daytype, starttime," +
"endtime, w2, w3, pc, tx, ldv, ldc, hdc, mdb, hdb from trafficcount"
+ "where id = '" + id + "' ORDER BY countdate";
ResultSet r = s.executeQuery(sql);
while (r.next()) {
String tag = r.getString(2);
Date date = r.getDate(3);
String dayType = r.getString(4);
Date startTime = r.getDate(5);
Date endTime = r.getDate(6);
int W2 = r.getInt(7);
int W3 = r.getInt(8);
int PC = r.getInt(9);
int TX = r.getInt(10);
int LDV = r.getInt(11);
int LDC = r.getInt(12);
int HDC = r.getInt(13);
int MDB = r.getInt(14);
int HDB = r.getInt(15);
trafficCountRecord.setId(id);
trafficCountRecord.setDate(date);
trafficCountRecord.setDayType(dayType);
trafficCountRecord.setEndTime(endTime);
trafficCountRecord.setHDB(HDB);
trafficCountRecord.setHDC(HDC);
trafficCountRecord.setLDC(LDC);
trafficCountRecord.setLDV(LDV);
trafficCountRecord.setMDB(MDB);
trafficCountRecord.setPC(PC);
trafficCountRecord.setStartTime(startTime);
trafficCountRecord.setTag(tag);
trafficCountRecord.setTX(TX);
trafficCountRecord.setW2(W2);
trafficCountRecord.setW3(W3);
}
connection.close(); // returns connection to pool