ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/cms/source/reports/DBReporter2/DBReporterMain.java
(Generate patch)

Comparing projects/cms/source/reports/DBReporter2/DBReporterMain.java (file contents):
Revision 1.1 by pjm2, Sat Feb 3 14:56:14 2001 UTC vs.
Revision 1.4 by pjm2, Sat Feb 3 22:11:39 2001 UTC

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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines