@Override
	public int getFlightForDate(Date date, Airport from) throws ConnectException {
		long timestamp = date.getTime();
		String sql = "SELECT idFlight FROM flight where Date = " + timestamp + " OR ( Date <=  " + (timestamp+3600000L) + " AND Date >= " + (timestamp-3600000L) + ") AND DepartureAirport = "
				+ from.ordinal() + " LIMIT 1";
		ResultSet result = executeQuery(sql);
		try {
			if (result != null && result.next()) {
				return result.getInt(1);
			}
		} catch (SQLException e) {
			e.printStackTrace();
		} finally {
			try {
				if(result != null) {
					result.close();
				}
			} catch (SQLException e) {
				e.printStackTrace();
			}
		}

		return 0;
	}