public Integer getPrimaryGroup(Connection con, String user) {
		/* Compose query. */
		String SQL_QUERY = "SELECT user_group_id "
				+ "FROM xf_user "
				+ "WHERE username=?;";

		/* Execute query. */
		try {
			PreparedStatement stmt = con.prepareStatement(SQL_QUERY);
			stmt.setString(1, user);
			ResultSet rs = stmt.executeQuery();
			
			/* Return first result */
			if(rs.next()) {
				Integer result = rs.getInt("user_group_id");
				return result;
			}
		} catch (SQLException e) {
			e.printStackTrace();
			
		}
		return null;
	}