public void run() {
		
		con = openDatabase();
		
		if (con == null) {
			System.err.println("Connection to database couldn't be established.");
			return;
		}
		
		// gerhard: use UTC (GMT) as time zone for table names
		Calendar currTime = new GregorianCalendar(TimeZone.getTimeZone("GMT+00:00"));
		int day = 0;
		
		System.out.println("StartTime Aggregator: " +  new GregorianCalendar().getTime());
		
		//use last midnight as reference point
		currTime.set(Calendar.HOUR, 0);
		currTime.set(Calendar.MINUTE, 0);
		currTime.set(Calendar.SECOND, 0);
		currTime.set(Calendar.MILLISECOND, 0);
		currTime.set(Calendar.AM_PM, Calendar.AM);
		
		try {
			s = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
		
			result = s.executeQuery("SHOW TABLES LIKE 'h\\_%'");
			
			while (result.next()) {
				
				tableName = result.getString(1);
				
				aggregateTables(s, tableName, currTime);
			
			}
			
			Iterator it = knownTables.iterator();
			
			while (it.hasNext()) {
				removeDuplicates(s, (String)it.next());
				it.remove();
			}
			
			result = s.executeQuery("SHOW TABLES LIKE 'd\\_%'");
			
			if (currTime.get(Calendar.DAY_OF_WEEK) != Calendar.MONDAY) {
				
				currTime.setLenient(true);
				
				do {
					currTime.roll(Calendar.DATE, -1);
				} while (currTime.get(Calendar.DAY_OF_WEEK) != Calendar.MONDAY);
				
			}
			
			while(result.next()) {
				
				tableName = result.getString(1);
				
				aggregateTablesOnlyPortsGreater1024(s, tableName, currTime);
			}
			
		} catch (SQLException e) {
			System.err.println("Error while aggregating tables.");
			System.err.println(e.getMessage());
		}
		
		System.out.println("EndTime Aggregator: " + new GregorianCalendar().getTime());
	}