1 |
pjm2 |
1.1 |
import java.sql.*; |
2 |
|
|
import java.io.*; |
3 |
|
|
|
4 |
pjm2 |
1.2 |
// Main method to run the reports. |
5 |
pjm2 |
1.1 |
public class DBReporterMain { |
6 |
|
|
|
7 |
|
|
public static void main(String[] args) { |
8 |
|
|
|
9 |
|
|
long endTime = DateUtils.startOfToday(); |
10 |
pjm2 |
1.2 |
|
11 |
|
|
// Uncomment next line to go back in time... |
12 |
|
|
//endTime = DateUtils.subtractDays(endTime, 2); |
13 |
|
|
|
14 |
pjm2 |
1.1 |
long startTime = DateUtils.subtractDays(endTime, 1); |
15 |
|
|
|
16 |
|
|
DBReporter reporter = new DBReporter(startTime, endTime); |
17 |
|
|
|
18 |
|
|
ReportList reportList = null; |
19 |
|
|
try { |
20 |
|
|
reportList = new ReportList("report_list.txt"); |
21 |
|
|
} |
22 |
|
|
catch (IOException e) { |
23 |
|
|
System.out.println(e); |
24 |
|
|
return; |
25 |
|
|
} |
26 |
|
|
|
27 |
|
|
try { |
28 |
|
|
reporter.runReports(reportList); |
29 |
|
|
} |
30 |
|
|
catch (SQLException e) { |
31 |
|
|
System.out.println("Fatal SQL errors - Cannot complete reports: " + e); |
32 |
|
|
} |
33 |
|
|
catch (Exception e) { |
34 |
|
|
System.out.println("Fatal errors - Cannot complete reports: " + e); |
35 |
|
|
} |
36 |
|
|
|
37 |
|
|
System.out.println("DBReporterMain finished."); |
38 |
|
|
|
39 |
|
|
} |
40 |
|
|
|
41 |
|
|
} |