public static boolean CheckUserProfile(Map<String, String> ProfileData)
			throws SQLException {
		boolean success = false;
		boolean found = false;
		for (int j = 0; j < GlobalData.UserProfileRecs.size(); j++) {
			UserProfileRec rec = GlobalData.UserProfileRecs.get(j);
			if (rec.username.equalsIgnoreCase(ProfileData.get("username"))) {
				found = true;
				// String userid;
				// String username;
				String email = ProfileData.get("email");
				String address = ProfileData.get("address");
				String officehours = ProfileData.get("officehours");
				String telecontact = ProfileData.get("telecontact");
				String mobilecontacts = ProfileData.get("mobilecontacts");
				String logo = ProfileData.get("logo");

				if (!rec.email.equalsIgnoreCase(email)
						|| !rec.address.equalsIgnoreCase(address)
						|| !rec.officehours.equalsIgnoreCase(officehours)
						|| !rec.telecontact.equalsIgnoreCase(telecontact)
						|| !rec.mobilecontacts.equalsIgnoreCase(mobilecontacts)
					    || !rec.logo.equalsIgnoreCase(logo)){
					success = UpdateUserProfilesTable(ProfileData);
					rec.UpdateProfileRec(email, address, officehours,
							telecontact, mobilecontacts,logo);

				}

				break;
			}
		}

		if (!found) {
			success = InsertIntoUserProfilesTable(ProfileData);
			GlobalData.UserProfileRecs
					.add(new UserProfileRec(null, ProfileData));
		}

		return success;
	}