public static void insertTimeAndLocationSickContacts() {
		int numSickContacts = 17652991;
		int batchSize = 1000;
		System.out.println("Starting: insert location and time into sick contact table.");
		try {
			Connection con = dbConnect();
			PreparedStatement update = con.prepareStatement(
					"UPDATE "+sickConTbl+" SET locationID=?,time=? WHERE person1ID=? AND person2ID=?");
			System.out.println("start act");
			PreparedStatement getAct = con.prepareStatement(
					"SELECT sick_contact.person1ID,sick_contact.person2ID,a1.locationID,a1.startTime,a2.startTime " +
					"FROM sick_contact INNER JOIN " +
					"(activities AS a1 INNER JOIN activities AS a2 ON a1.locationID = a2.locationID AND a1.personID != a2.personID) " +
					"ON sick_contact.person1ID = a1.personID AND sick_contact.person2ID = a2.personID WHERE sick_contact.person1ID=? AND sick_contact.person2ID=?");
			System.out.println("end act");
			PreparedStatement getCon = con.prepareStatement(
					"SELECT person1ID,person2ID,time,locationID FROM "+sickConTbl+" LIMIT ?,"+batchSize);
			System.out.println("end con");
			for (int offset=0; offset <= numSickContacts; offset += batchSize) {
				getCon.setInt(1, offset);
				ResultSet getConQ = getCon.executeQuery();
				while (getConQ.next()) {
					if (getConQ.getInt("locationID") == 0 && getConQ.getLong("time") == 0) {
						int person1 = getConQ.getInt("person1ID");
						int person2 = getConQ.getInt("person2ID");
//						System.out.println(person1+" "+person2);
						update.setInt(3, person1);
						update.setInt(4, person2);
						getAct.setInt(1, person1);
						getAct.setInt(2, person2);
						ResultSet getActQ = getAct.executeQuery();
						long time = Long.MAX_VALUE;
						int location = -1;
						while (getActQ.next()) {
							long time1 = getActQ.getLong("a1.startTime");
							long time2 = getActQ.getLong("a2.startTime");
							if (time1 < time) {
								time = time1;
								location = getActQ.getInt("a1.locationID");
							}
							if (time2 < time) {
								time = time2;
								location = getActQ.getInt("a1.locationID");
							}
						}
//						System.out.println("person1: "+person1+" person2: "+person2+" location: "+location+" time: "+time);
						update.setInt(1, location);
						update.setLong(2, time);
						update.executeUpdate();
					}
				}
			}
			con.close();
		} catch (Exception e) {
			System.out.println(e);
		}
	}