code: protected boolean internalValidateUserInGroup(CmsDbContext dbc, CmsUUID userId, CmsUUID groupId)
      throws CmsDataAccessException {
  
          boolean userInGroup = false;
          PreparedStatement stmt = null;
          ResultSet res = null;
          Connection conn = null;
  
          try {
              conn = getSqlManager().getConnection(dbc);
              stmt = m_sqlManager.getPreparedStatement(conn, "C_GROUPS_USER_IN_GROUP_2");
  
              stmt.setString(1, groupId.toString());
              stmt.setString(2, userId.toString());
              res = stmt.executeQuery();
              if (res.next()) {
                  userInGroup = true;
                  while (res.next()) {
                      // do nothing only move through all rows because of mssql odbc driver
                  }
              }
          } catch (SQLException e) {
              throw new CmsDbSqlException(
                  Messages.get().container(Messages.ERR_GENERIC_SQL_1, CmsDbSqlException.getErrorQuery(stmt)),
                  e);
          } finally {
              m_sqlManager.closeAll(dbc, conn, stmt, res);
          }
  
          return userInGroup;
      }
docs: Checks if a user is member of a group.<p>
  
  @param dbc the database context
  @param userId the id of the user to check
  @param groupId the id of the group to check
  
  @return true if user is member of group
  
  @throws CmsDataAccessException if operation was not succesful