53 |
String sqlAvg = "SELECT count(*) AS count, round(avg(location+name+favorites),1) AS station, round(avg(location),1) as location, round(avg(name),1) as name, round(avg(favorites),1) as favorites, " + |
String sqlAvg = "SELECT count(*) AS count, round(avg(location+name+favorites),1) AS station, round(avg(location),1) as location, round(avg(name),1) as name, round(avg(favorites),1) as favorites, " + |
54 |
"round(avg(departure),1) as departure, round(avg(depcache),1) as depcache, round(avg(deperror),1) as deperror, " + |
"round(avg(departure),1) as departure, round(avg(depcache),1) as depcache, round(avg(deperror),1) as deperror, " + |
55 |
"round(avg(timetable),1) as timetable, round(avg(timecache),1) as timecache, round(avg(timeerror),1) as timeerror " + |
"round(avg(timetable),1) as timetable, round(avg(timecache),1) as timecache, round(avg(timeerror),1) as timeerror " + |
56 |
"FROM trainstatistics"; |
"FROM trainstatistics " + |
57 |
|
"WHERE statisticsdate <> now()::date "; |
58 |
|
|
59 |
ResultSet resAvg = stmt.executeQuery(sqlAvg); |
ResultSet resAvg = stmt.executeQuery(sqlAvg); |
60 |
resAvg.next(); |
resAvg.next(); |
76 |
stats.add(bean); |
stats.add(bean); |
77 |
|
|
78 |
} |
} |
79 |
|
|
80 |
|
conn.close(); |
81 |
|
|
82 |
|
|
83 |
request.setAttribute("avg", avgBean); |
request.setAttribute("avg", avgBean); |