public void checkStatus()
	{
		try
		{
			PreparedStatement stmt = connection.prepareStatement("select sum(s1.total) as total from sale s1 " +
					"where trim(s1.cid) = trim(?) " +
					"and (select count (s2.order_id) " +
					"from sale s2 " +
					"where s2.tstmp > s1.tstmp " +
					"and s1.cid = s2.cid ) < 3 ");

			stmt.setString(1, customerIdentifier);
			ResultSet rs = stmt.executeQuery();
			rs.next();
			double sum = rs.getDouble("total");
			if (sum < 100)
			{
				setStatus("Green");
			} else if (sum < 500)
			{
				setStatus("Silver");
			} else
			{
				setStatus("Gold");
			}
		} catch (SQLException e)
		{
			e.printStackTrace();
		}
	}