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