public static void doCounting() {
		Timestamp startDay = Timestamp.valueOf("2011-01-01 00:00:00.0");

		Timestamp nextDay = new Timestamp(startDay.getTime() + oneDayLong);

		final Timestamp endDay = Timestamp.valueOf("2012-05-01 00:00:00.0");

		while (startDay.before(endDay)) {
			System.out.println(startDay); // print info

			Statement stmt = null;
			ResultSet rs = null;
			try {

				stmt = conn.createStatement();
				String sqlTxt = "select *  from stream2 where t >= \'"
						+ startDay + "\' and t < \'" + nextDay + "\'";
				if (stmt.execute(sqlTxt)) {
					rs = stmt.getResultSet();
					while (rs.next()) {
						Tweet tweet = new Tweet(rs.getString("user_ID"),
								rs.getString("status_ID"),
								rs.getString("tweet"), rs.getTimestamp("t"));
						count(tweet);
					}
				}

			} catch (SQLException ex) {
				// handle any errors
				System.out.println("SQLException: " + ex.getMessage());
				System.out.println("SQLState: " + ex.getSQLState());
				System.out.println("VendorError: " + ex.getErrorCode());

			} finally {
				// it is a good idea to release
				// resources in a finally{} block
				// in reverse-order of their creation
				// if they are no-longer needed
				if (rs != null) {
					try {
						rs.close();
					} catch (SQLException sqlEx) {
					} // ignore
					rs = null;
				}
				if (stmt != null) {
					try {
						stmt.close();
					} catch (SQLException sqlEx) {
					} // ignore
					stmt = null;
				}
			}

			startDay = nextDay;
			nextDay = new Timestamp(startDay.getTime() + oneDayLong);
		}

		System.out.println("Size of the counter" + counter.size());
		for (Map.Entry<String, Integer> entry : counter.entrySet()) {
			saveCount(entry.getKey(), entry.getValue());
		}
	}