+ public int getTotalJobsCount(Timestamp from, Timestamp to)\r
+ throws SQLException {\r
+ String allQuery = "select count(*) from exec_stat where start BETWEEN ? and ? ";\r
+ return getIntResult(from, to, allQuery);\r
+ }\r
+\r
+ public int getCancelledCount(Timestamp from, Timestamp to)\r
+ throws SQLException {\r
+ // js.isCancelled\r
+ String cancelledQuery = "select count(*) from exec_stat where start BETWEEN ? and ? and isCancelled=1 ";\r
+ return getIntResult(from, to, cancelledQuery);\r
+ }\r
+\r
+ public int getAbandonedCount(Timestamp from, Timestamp to)\r
+ throws SQLException {\r
+ // !js.isCollected && !js.isCancelled && js.hasResult()\r
+ String abandonedQuery = "select count(*) from exec_stat where start BETWEEN ? and ? and isCollected=0 and isCancelled=0 and resultsize>0 ";\r
+ return getIntResult(from, to, abandonedQuery);\r
+ }\r
+\r
+ public int getIncompleteCount(Timestamp from, Timestamp to)\r
+ throws SQLException {\r
+ // !js.hasResult()\r
+ String incompleteQuery = "select count(*) from exec_stat where start BETWEEN ? and ? and resultsize<=0 ";\r
+ return getIntResult(from, to, incompleteQuery);\r
+ }\r
+\r
+ private int getIntResult(Timestamp from, Timestamp to, String query)\r
+ throws SQLException {\r
+\r
+ log.debug("getIntRes: QUERY: " + query);\r
+ log.debug("getIntRes: FROM: " + from);\r
+ log.debug("getIntRes: TO: " + to);\r
+\r
+ PreparedStatement pstm = conn.prepareStatement(query);\r
+ pstm.setTimestamp(1, from);\r
+ pstm.setTimestamp(2, to);\r
+ pstm.execute();\r
+ ResultSet res = pstm.getResultSet();\r
+ boolean exist = res.next();\r
+ int count = 0;\r
+ if (exist) {\r
+ count = res.getInt(1);\r
+ }\r
+ log.debug("getIntRes: RES: " + count);\r
+ res.close();\r
+ pstm.close();\r
+ return count;\r
+ }\r
+\r