@Override
    public Group getGroup(String name) throws GroupNotFoundException {
        String description = null;

        Connection con = null;
        PreparedStatement pstmt = null;
        ResultSet rs = null;
        try {
            con = DbConnectionManager.getConnection();
            pstmt = con.prepareStatement(LOAD_GROUP);
            pstmt.setString(1, name);
            rs = pstmt.executeQuery();
            if (!rs.next()) {
                throw new GroupNotFoundException("Group with name "
                    + name + " not found.");
            }
            description = rs.getString(1);
        }
        catch (SQLException e) {
            Log.error(e.getMessage(), e);
        }
        finally {
            DbConnectionManager.closeConnection(rs, pstmt, con);
        }

        // TODO Replace these two database queries with one. OF-2710
        Collection<JID> members = getMembers(name, false);
        Collection<JID> administrators = getMembers(name, true);

        return new Group(name, description, members, administrators);
    }
Database implementation of the GroupManager interface.

@author Matt Tucker
xmppserver/src/main/java/org/jivesoftware/openfire/group/DefaultGroupProvider.java