private Timestamp getLastUpdatePrice(Timestamp today)
			throws SQLException {
		Connection conn = DriverManager.getConnection(Utils.CONNECT_STRING);
		Timestamp firstTime = today;
		String latestPriceTimeSql = "select MAX(Time) as time from PH_PRICE where TIME <= ?";
		PreparedStatement lastPriceTimeStatement = conn
				.prepareStatement(latestPriceTimeSql);
		lastPriceTimeStatement.setTimestamp(1, today);
		ResultSet lastPriceTimeRet = lastPriceTimeStatement.executeQuery();
		if (lastPriceTimeRet != null) {
			while (lastPriceTimeRet.next()) {
				firstTime = lastPriceTimeRet.getTimestamp(1);
			}
		}
		if(!conn.isClosed()){
			conn.close();
		}
		return firstTime;
	}