15 |
import javax.servlet.http.HttpServletRequest; |
import javax.servlet.http.HttpServletRequest; |
16 |
import javax.servlet.http.HttpServletResponse; |
import javax.servlet.http.HttpServletResponse; |
17 |
|
|
18 |
|
import dk.thoerup.traininfoservice.db.DBConnection; |
19 |
|
|
20 |
|
|
21 |
@WebServlet(urlPatterns={"/SavedStatistics"}) |
@WebServlet(urlPatterns={"/SavedStatistics"}) |
22 |
public class SavedStatistics extends HttpServlet { |
public class SavedStatistics extends HttpServlet { |
55 |
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, " + |
56 |
"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, " + |
57 |
"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 " + |
58 |
"FROM trainstatistics"; |
"FROM trainstatistics " + |
59 |
|
"WHERE statisticsdate <> now()::date "; |
60 |
|
|
61 |
ResultSet resAvg = stmt.executeQuery(sqlAvg); |
ResultSet resAvg = stmt.executeQuery(sqlAvg); |
62 |
resAvg.next(); |
resAvg.next(); |