* @return the UserProfile instance
* @throws SQLException
* if any error occurs
*/
private UserProfile populateUserProfile(ResultSet rs) throws SQLException {
UserProfile profile = new UserProfile();
profile.setId(rs.getLong(DatabaseConstants.USER_PROFILE_USER_PROFILE_ID));
profile.setHandle(rs.getString(DatabaseConstants.USER_PROFILE_HANDLE));
profile.setPassword(rs.getString(DatabaseConstants.USER_PROFILE_PASSWORD));
profile.setEmail(rs.getString(DatabaseConstants.USER_PROFILE_EMAIL_ADDRESS));
profile.setRegDate(rs.getTimestamp(DatabaseConstants.USER_PROFILE_REG_DATE));
profile.setFirstName(rs.getString(DatabaseConstants.USER_PROFILE_FIRST_NAME));
profile.setLastName(rs.getString(DatabaseConstants.USER_PROFILE_LAST_NAME));
profile.setAddressLine1(rs.getString(DatabaseConstants.USER_PROFILE_ADDRESS_LINE1));
profile.setAddressLine2(rs.getString(DatabaseConstants.USER_PROFILE_ADDRESS_LINE2));
profile.setCity(rs.getString(DatabaseConstants.USER_PROFILE_CITY));
profile.setState(rs.getString(DatabaseConstants.USER_PROFILE_STATE));
profile.setCountry(new Country(rs.getLong(DatabaseConstants.USER_PROFILE_COUNTRY_ID), "foo"));
profile.setZipCode(rs.getString(DatabaseConstants.USER_PROFILE_ZIP_CODE));
profile.setPhoneNumber(rs.getString(DatabaseConstants.USER_PROFILE_PHONE_NUMBER));
profile.setBirthDate(rs.getDate(DatabaseConstants.USER_PROFILE_BIRTH_DATE));
String gender = rs.getString(DatabaseConstants.USER_PROFILE_GENDER);
profile.setGender(gender == null || gender.length() == 0 ? ' ' : gender.charAt(0));
profile.setSchool(rs.getString(DatabaseConstants.USER_PROFILE_SCHOOL));
profile.setMajor(rs.getString(DatabaseConstants.USER_PROFILE_MAJOR));
profile.setGraduateStudent(rs.getBoolean(DatabaseConstants.USER_PROFILE_GRADUATE_STUDENT));
profile.setGraduationYear(rs.getInt(DatabaseConstants.USER_PROFILE_GRADUATION_YEAR));
profile.setStudentNumber(rs.getString(DatabaseConstants.USER_PROFILE_STUDENT_NUMBER));
profile.setConfirmed(rs.getBoolean(DatabaseConstants.USER_PROFILE_CONFIRMED));
profile.setActive(rs.getBoolean(DatabaseConstants.USER_PROFILE_ACTIVE));
profile.setNickName(rs.getString("nickname"));
profile.setOldEmail(rs.getString("old_email"));
return profile;
}