MergeAssignConfiguration
        this.configuration = configuration;

        try
        {
            java.util.Properties osid_registry_properties = new java.util.Properties();
            java.io.InputStream istream = ClassLoader.getSystemResourceAsStream("osid_registry.properties");
            if (istream != null) 
            {
                osid_registry_properties.load(istream);
            }
            else
            {
                throw new org.osid.agent.AgentException(
                    org.osid.agent.AgentException.CONFIGURATION_ERROR);
            }
            
            String idImplementation = osid_registry_properties.getProperty("osid_20_Id_Implementation");
            String authorizationImplementation = osid_registry_properties.getProperty("osid_20_Authorization_Implementation");  
            String loggingImplementation = osid_registry_properties.getProperty("osid_20_Logging_Implementation");  
            String sqlImplementation =  osid_registry_properties.getProperty("osid_20_Sql_Implementation");  
/*
            String idImplementation =      "comet.osidimpl.id.no_persist";
            String loggingImplementation = "comet.osidimpl.logging.plain";  
            String sqlImplementation =     "comet.osidimpl.sql.remote";  
            String authorizationImplementation =     "comet.osidimpl.authorization.sql";  
*/
            String logFilename = (String)configuration.get("log_filename");            
            String databaseURL = (String)configuration.get("databaseURL");
            
            String loggingFormatTypeDomain = (String)configuration.get("loggingFormatType_domain");
            String loggingFormatTypeAuthority = (String)configuration.get("loggingFormatType_authority");
            String loggingFormatTypeKeyword = (String)configuration.get("loggingFormatType_keyword");
            String loggingPriorityTypeDomain = (String)configuration.get("loggingPriorityType_domain");
            String loggingPriorityTypeAuthority = (String)configuration.get("loggingPriorityType_authority");
            String loggingPriorityTypeKeyword = (String)configuration.get("loggingPriorityType_keyword");
            
            if ( (loggingImplementation == null) || (logFilename == null) || (loggingFormatTypeDomain == null) ||
                 (loggingFormatTypeAuthority == null) || (loggingFormatTypeKeyword == null) ||
                 (loggingPriorityTypeDomain == null) || (loggingPriorityTypeAuthority == null) || 
                 (loggingPriorityTypeKeyword == null) )                  
            {
                throw new org.osid.agent.AgentException(
                    org.osid.agent.AgentException.CONFIGURATION_ERROR);
            }
            else
            {
                loggingManager = (org.osid.logging.LoggingManager)org.osid.OsidLoader.getManager(
                    "org.osid.logging.LoggingManager",
                    loggingImplementation,
                    this.context,
                    new java.util.Properties());
                try
                {
                    log = loggingManager.getLogForWriting(logFilename);
                }
                catch (org.osid.logging.LoggingException lex)
                {
                    log = loggingManager.createLog(logFilename);
                }
                log.assignFormatType(new Type(
                    loggingFormatTypeDomain,loggingFormatTypeAuthority,loggingFormatTypeKeyword,""));
                log.assignPriorityType(new Type(
                    loggingPriorityTypeDomain,loggingPriorityTypeAuthority,loggingPriorityTypeKeyword,""));
            }
            
            if (sqlImplementation == null) 
            {
                log("no SQL Implementation configuration");
                throw new org.osid.agent.AgentException(
                    org.osid.agent.AgentException.CONFIGURATION_ERROR);
            }
            if (idImplementation == null)
            {
                log("no Id Implementation configuration");
                throw new org.osid.agent.AgentException(
                    org.osid.agent.AgentException.CONFIGURATION_ERROR);
            }
            if (databaseURL == null)
            {
                log("invalid database URL");
                throw new org.osid.agent.AgentException(
                    org.osid.agent.AgentException.CONFIGURATION_ERROR);
            }
            
            sqlManager = (org.osid.sql.SqlManager)org.osid.OsidLoader.getManager(
                "org.osid.sql.SqlManager",
                sqlImplementation,
                this.context,
                new java.util.Properties());                

            // place database access username and password in context for sql implementation to find
            context.assignContext("sqlusername_mmedia_agent","oki");
            context.assignContext("sqlpassword_mmedia_agent","oki");
            connection = sqlManager.getConnection(databaseURL);

            idManager = (org.osid.id.IdManager)org.osid.OsidLoader.getManager(
                "org.osid.id.IdManager",
                idImplementation,
                this.context,
                new java.util.Properties());
        }
        catch (Throwable t)
        {
            log(t.getMessage());
            if (t instanceof org.osid.agent.AgentException)
            {
                throw new org.osid.agent.AgentException(
                    t.getMessage());
            }
            else
            {                
                throw new org.osid.agent.AgentException(
                    org.osid.agent.AgentException.OPERATION_FAILED);
            }
        }                
MergeTableToTypes
        // table already has rows of values in order: authority, domain, keyword, descr
        String statement = "";    
        java.util.Vector result = new java.util.Vector();
        try
        {
            org.osid.sql.RowIterator rowIterator = table.getRows();
            while (rowIterator.hasNextRow())
            {
                org.osid.shared.ObjectIterator objectIterator = rowIterator.nextRow().getColumns();
                int position = 0;
                String domain = "";
                String authority = "";
                String keyword = "";
                String description = "";
                
                while (objectIterator.hasNextObject())
                {
                    Object o = objectIterator.nextObject();
                    if (o instanceof String)
                    {
                        if (position == 0) authority = (String)o;
                        else if (position == 1) domain = (String)o; 
                        else if (position == 2) keyword = (String)o; 
                        else if (position == 3) description = (String)o;
                    }
                    position++;
                }
                result.addElement(new Type(authority,domain,keyword,description));
            }
            return result;
        }
        catch (Throwable t)
        {
            log(t.getMessage());
            throw new org.osid.agent.AgentException(
                org.osid.agent.AgentException.OPERATION_FAILED);
        }
MergeLog
        if (log != null)
        {
            try
            {
                log.appendLog(entry);
            }
            catch (org.osid.logging.LoggingException lex) 
            {
                // swallow exception since logging is a best attempt to log an exception anyway
            }   
        }
MergeTypeConstructor3
        super(authority,domain,keyword);        
MergeTypeConstructor4
        super(authority,domain,keyword,description);        
MergeCreateAgent
        if ( (displayName == null) || (agentType == null) )
        {
            throw new org.osid.agent.AgentException(org.osid.agent.AgentException.NULL_ARGUMENT);
        }
        
        // check for known types
        String statement = "";
        boolean found = false;

        Integer agentTypeKey = new Integer(0);
        try
        {
            statement = "SELECT agent_type_key FROM agent_type WHERE " + 
                        " authority = '" + agentType.getAuthority() + "'" + 
                        " AND domain = '" + agentType.getDomain() + "'" + 
                        " AND keyword = '" + agentType.getKeyword() + "';";
            org.osid.sql.ResultTable table = connection.executeQuery(statement);
            org.osid.sql.RowIterator rowIterator = table.getRows();
            if (rowIterator.hasNextRow())
            {
                org.osid.shared.ObjectIterator objectIterator = rowIterator.nextRow().getColumns();
                if (objectIterator.hasNextObject())
                {
                    Object o = objectIterator.nextObject();
                    if (o instanceof Integer)
                    {
                        agentTypeKey = (Integer)o;
                        found = true;
                    }
                }                        
            }
        }
        catch (Throwable t)
        {
            log(statement);
            log(t.getMessage());
            throw new org.osid.agent.AgentException(org.osid.agent.AgentException.OPERATION_FAILED);
        }
        if (!found)
        {
            throw new org.osid.agent.AgentException(org.osid.agent.AgentException.UNKNOWN_TYPE);
        }
        
        // add to database
        org.osid.shared.Id id = null;
        String idString = null;
        try
        {
        
            String email = "";
            String firstname = "";
            String lastname = "";
        
            java.util.Calendar calendar = java.util.Calendar.getInstance();
            java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat("yyyy/MM/dd:HH:mm:ss");
            String date = sdf.format(calendar.getTime());
        
            if (properties != null)
            {
                java.io.Serializable o = properties.getProperty("email");
                if (o instanceof String)
                {
                    email = (String)o;
                }
                o = properties.getProperty("firstname");
                if (o instanceof String)
                {
                    firstname = (String)o;
                }
                o = properties.getProperty("lastname");
                if (o instanceof String)
                {
                    lastname = (String)o;
                }
            }
        
            id = idManager.createId();
            idString = id.getIdString();
            
            statement = "INSERT INTO agent (agent_id, agent_type_key, display_name, lastname, firstname, email, creation_date, modified_date, modified_by) VALUES ("
                 + "'" + idString + "',"
                 + agentTypeKey + ","
                 + "'" + displayName + "',"
                 + "'" + lastname + "',"
                 + "'" + firstname + "',"
                 + "'" + email + "',"
                 + "'" + date + "',"
                 + "'" + date + "',"
                 + "'" + idString + "');";
                 
            this.connection.executeUpdate(statement);
            
            statement = "INSERT INTO agent_properties(agent_id,type_key) VALUES ('" + idString + "'," + agentTypeKey + ");";
            this.connection.executeUpdate(statement);
        }
        catch (Throwable t)
        {
            log(statement);
            log(t.getMessage());
            throw new org.osid.agent.AgentException(org.osid.agent.AgentException.OPERATION_FAILED);
        }
        return new Agent(id,idString,connection,log,this.idManager);        
MergeDeleteAgent
        if (agentId == null)
        {
            throw new org.osid.agent.AgentException(org.osid.agent.AgentException.NULL_ARGUMENT);    
        }

        int result = -1;
        String statement = "";
        try
        {
            statement = "DELETE FROM agent WHERE agent_id = '" + agentId.getIdString() + "';";
            result = connection.executeUpdate(statement);
            
            // remove related entries in other tables?
            
            statement = "DELETE FROM group_member WHERE member_id = '" + agentId.getIdString() + "';";
            int discard = connection.executeUpdate(statement);
        }
        catch(Throwable t)
        {
            log(statement);
            log(t.getMessage());
            throw new org.osid.agent.AgentException(org.osid.agent.AgentException.OPERATION_FAILED);
        }
        if (result == 0)
        {
            throw new org.osid.agent.AgentException(org.osid.agent.AgentException.UNKNOWN_ID);
        }        
MergeGetAgent
        if (agentId == null)
        {
            throw new org.osid.agent.AgentException(org.osid.agent.AgentException.NULL_ARGUMENT);    
        }
        String statement = "";
        try
        {
            statement = "SELECT agent_id FROM agent WHERE agent_id = " +
                        "'" + agentId.getIdString() + "';";
            org.osid.sql.ResultTable table = connection.executeQuery(statement);
            org.osid.sql.RowIterator rowIterator = table.getRows();
            while (rowIterator.hasNextRow())
            {
                org.osid.shared.ObjectIterator objectIterator = rowIterator.nextRow().getColumns();
                if (objectIterator.hasNextObject())
                {
                    Object o = objectIterator.nextObject();
                    if (o instanceof String)
                    {
                        String idString = (String)o;
                        org.osid.shared.Id id = idManager.getId(idString);
                        return new Agent(id,idString,connection,log,this.idManager);
                    }
                }
            }
        }
        catch(Throwable t)
        {
            log(statement);
            log(t.getMessage());
            throw new org.osid.agent.AgentException(org.osid.agent.AgentException.OPERATION_FAILED);
        }
        throw new org.osid.agent.AgentException(org.osid.agent.AgentException.UNKNOWN_ID);
MergeGetAgents
        java.util.Vector result = new java.util.Vector();
        String statement = "";
        try
        {
            statement = "SELECT agent_id FROM agent;";
            org.osid.sql.ResultTable table = connection.executeQuery(statement);
            
            // make agents from each row
            org.osid.sql.RowIterator rowIterator = table.getRows();
            while (rowIterator.hasNextRow())
            {
                org.osid.shared.ObjectIterator objectIterator = rowIterator.nextRow().getColumns();
                if (objectIterator.hasNextObject())
                {
                    Object o = objectIterator.nextObject();
                    if (o instanceof String)
                    {
                        String idString = (String)o;
                        org.osid.shared.Id id = idManager.getId(idString);
                        result.addElement(new Agent(id,idString,connection,log,this.idManager));
                    }
                }
            }
        }
        catch(Throwable t)
        {
            log(statement);
            log(t.getMessage());
            throw new org.osid.agent.AgentException(org.osid.agent.AgentException.OPERATION_FAILED);
        }
        return new AgentIterator(result);
MergeGetAgentsType
        if (agentType == null)
        {
            throw new org.osid.agent.AgentException(org.osid.agent.AgentException.NULL_ARGUMENT);
        }
        java.util.Vector result = new java.util.Vector();
        String statement = "";
        
        try
        {
            statement = "SELECT agent.agent_id FROM agent, agent_type WHERE " + 
                        "agent.agent_type_key = agent_type.agent_type_key " + 
                        "AND agent_type.authority = '" + agentType.getAuthority() + "' " + 
                        "AND agent_type.domain = '" + agentType.getDomain() + "' " + 
                        "AND agent_type.keyword = '" + agentType.getKeyword() + "';";

            org.osid.sql.ResultTable table = connection.executeQuery(statement);
            
            // make agents from each row
            org.osid.sql.RowIterator rowIterator = table.getRows();
            while (rowIterator.hasNextRow())
            {
                org.osid.shared.ObjectIterator objectIterator = rowIterator.nextRow().getColumns();
                if (objectIterator.hasNextObject())
                {
                    Object o = objectIterator.nextObject();
                    if (o instanceof String)
                    {
                        String idString = (String)o;
                        org.osid.shared.Id id = idManager.getId(idString);
                        result.addElement(new Agent(id,idString,connection,log,this.idManager));
                    }
                }
            }
        }
        catch(Throwable t)
        {
            log(statement);
            log(t.getMessage());
            throw new org.osid.agent.AgentException(org.osid.agent.AgentException.OPERATION_FAILED);
        }
        return new AgentIterator(result);
MergeGetAgentTypes
        String statement = "";
        try
        {
            statement = "SELECT authority, domain, keyword, descr FROM agent_type;";
            org.osid.sql.ResultTable table = connection.executeQuery(statement);
            java.util.Vector vector = tableToTypes(table);
            return new TypeIterator(vector);
        }
        catch (Throwable t)
        {
            log(statement);
            log(t.getMessage());
            throw new org.osid.agent.AgentException(org.osid.agent.AgentException.OPERATION_FAILED);
        }
MergeCreateGroup
        if ( (displayName == null) || (groupType == null) || (description == null) )
        {
            throw new org.osid.agent.AgentException(org.osid.agent.AgentException.NULL_ARGUMENT);
        }
        
        // check for known types
        String statement = "";
        boolean found = false;

        Integer groupTypeKey = new Integer(0);
        try
        {
            statement = "SELECT group_type_key FROM group_type WHERE " + 
                        " domain = '" + groupType.getDomain() + "'" + 
                        " AND authority = '" + groupType.getAuthority() + "'" + 
                        " AND keyword = '" + groupType.getKeyword() + "';";

            org.osid.sql.ResultTable table = connection.executeQuery(statement);
            org.osid.sql.RowIterator rowIterator = table.getRows();
            if (rowIterator.hasNextRow())
            {
                org.osid.shared.ObjectIterator objectIterator = rowIterator.nextRow().getColumns();
                if (objectIterator.hasNextObject())
                {
                    Object o = objectIterator.nextObject();
                    if (o instanceof Integer)
                    {
                        groupTypeKey = (Integer)o;
                        found = true;
                    }
                }                        
            }
        }
        catch (Throwable t)
        {
            log(statement);
            log(t.getMessage());
            throw new org.osid.agent.AgentException(org.osid.agent.AgentException.OPERATION_FAILED);
        }
        if (!found)
        {
            throw new org.osid.agent.AgentException(org.osid.agent.AgentException.UNKNOWN_TYPE);
        }
        
        // add to database
        org.osid.shared.Id id = null;
        String idString = null;
        try
        {
            id = idManager.createId();
            idString = id.getIdString();
            
            statement = "INSERT INTO groups (group_id, group_type_key, display_name, description) VALUES ("
                 + "'" + idString + "',"
                 + "'" + groupTypeKey + "',"
                 + "'" + displayName + "',"
                 + "'" + description + "');";
                 
            this.connection.executeUpdate(statement);
        }
        catch (Throwable t)
        {
            log(statement);
            log(t.getMessage());
            throw new org.osid.agent.AgentException(org.osid.agent.AgentException.OPERATION_FAILED);
        }
        return new Group(id,idString,connection,log,this.idManager);        
MergeDeleteGroup
        if (groupId == null)
        {
            throw new org.osid.agent.AgentException(org.osid.agent.AgentException.NULL_ARGUMENT);    
        }

        int result = -1;
        String statement = "";
        try
        {
            statement = "DELETE FROM groups WHERE group_id = '" + groupId.getIdString() + "';";
            result = connection.executeUpdate(statement);
            
            // remove related entries in other tables?
            
            statement = "DELETE FROM group_member WHERE member_id = '" + groupId.getIdString() + "';";
            int discard = connection.executeUpdate(statement);
            statement = "DELETE FROM group_member WHERE group_id = '" + groupId.getIdString() + "';";
            discard = connection.executeUpdate(statement);
        }
        catch(Throwable t)
        {
            log(statement);
            log(t.getMessage());
            throw new org.osid.agent.AgentException(org.osid.agent.AgentException.OPERATION_FAILED);
        }
        if (result == 0)
        {
            throw new org.osid.agent.AgentException(org.osid.agent.AgentException.UNKNOWN_ID);
        }        
MergeGetGroup
        if (groupId == null)
        {
            throw new org.osid.agent.AgentException(org.osid.agent.AgentException.NULL_ARGUMENT);    
        }
        String statement = "";
        try
        {
            statement = "SELECT group_id FROM groups WHERE group_id = " +
                        "'" + groupId.getIdString() + "';";
            org.osid.sql.ResultTable table = connection.executeQuery(statement);
            org.osid.sql.RowIterator rowIterator = table.getRows();
            while (rowIterator.hasNextRow())
            {
                org.osid.shared.ObjectIterator objectIterator = rowIterator.nextRow().getColumns();
                if (objectIterator.hasNextObject())
                {
                    Object o = objectIterator.nextObject();
                    if (o instanceof String)
                    {
                        String idString = (String)o;
                        org.osid.shared.Id id = idManager.getId(idString);
                        return new Group(id,idString,connection,log,this.idManager);
                    }
                }
            }
        }
        catch(Throwable t)
        {
            log(statement);
            log(t.getMessage());
            throw new org.osid.agent.AgentException(org.osid.agent.AgentException.OPERATION_FAILED);
        }
        throw new org.osid.agent.AgentException(org.osid.agent.AgentException.UNKNOWN_ID);
MergeGetGroups
        java.util.Vector result = new java.util.Vector();
        String statement = "";
        try
        {
            statement = "SELECT group_id FROM groups;";
            org.osid.sql.ResultTable table = connection.executeQuery(statement);
            org.osid.sql.RowIterator rowIterator = table.getRows();
            while (rowIterator.hasNextRow())
            {
                org.osid.shared.ObjectIterator objectIterator = rowIterator.nextRow().getColumns();
                if (objectIterator.hasNextObject())
                {
                    Object o = objectIterator.nextObject();
                    if (o instanceof String)
                    {
                        String idString = (String)o;
                        org.osid.shared.Id id = idManager.getId(idString);
                        result.addElement(new Group(id,idString,connection,log,this.idManager));
                    }
                }
            }
            return new AgentIterator(result);
        }
        catch(Throwable t)
        {
            log(statement);
            log(t.getMessage());
            throw new org.osid.agent.AgentException(org.osid.agent.AgentException.OPERATION_FAILED);
        }
MergeGetGroupsType
        if (groupType == null)
        {
            throw new org.osid.agent.AgentException(org.osid.agent.AgentException.NULL_ARGUMENT);
        }
        java.util.Vector result = new java.util.Vector();
        String statement = "";
        
        try
        {
            statement = "SELECT groups.group_id FROM groups, group_type WHERE " + 
                        "groups.group_type_key = group_type.group_type_key " + 
                        "AND group_type.authority = '" + groupType.getAuthority() + "' " + 
                        "AND group_type.domain = '" + groupType.getDomain() + "' " + 
                        "AND group_type.keyword = '" + groupType.getKeyword() + "';";

            org.osid.sql.ResultTable table = connection.executeQuery(statement);
            
            // make agents from each row
            org.osid.sql.RowIterator rowIterator = table.getRows();
            while (rowIterator.hasNextRow())
            {
                org.osid.shared.ObjectIterator objectIterator = rowIterator.nextRow().getColumns();
                if (objectIterator.hasNextObject())
                {
                    Object o = objectIterator.nextObject();
                    if (o instanceof String)
                    {
                        String idString = (String)o;
                        org.osid.shared.Id id = idManager.getId(idString);
                        result.addElement(new Group(id,idString,connection,log,this.idManager));
                    }
                }
            }
        }
        catch(Throwable t)
        {
            log(statement);
            log(t.getMessage());
            throw new org.osid.agent.AgentException(org.osid.agent.AgentException.OPERATION_FAILED);
        }
        return new AgentIterator(result);
MergeGetGroupTypes
        String statement = "";
        try
        {
            statement = "SELECT authority, domain, keyword, descr FROM group_type;";
            org.osid.sql.ResultTable table = connection.executeQuery(statement);
            java.util.Vector vector = tableToTypes(table);
            return new TypeIterator(vector);
        }
        catch (Throwable t)
        {
            log(statement);
            log(t.getMessage());
            throw new org.osid.agent.AgentException(org.osid.agent.AgentException.OPERATION_FAILED);
        }
MergeManagerGetGroupsBySearch
        if ( (searchCriteria == null) || (groupSearchType == null) )
        {
            throw new org.osid.agent.AgentException(org.osid.agent.AgentException.NULL_ARGUMENT);
        }

        if (!(groupSearchType.isEqual(this.groupSearchType)))
        {
            throw new org.osid.agent.AgentException(org.osid.agent.AgentException.UNKNOWN_TYPE);
        }
        
        // maybe UNKNNOWN_TYPE is a more appropriate exception than OPERATION_FAILED
        if (!(searchCriteria instanceof String))
        {
            throw new org.osid.agent.AgentException(org.osid.agent.AgentException.UNKNOWN_TYPE);
        }
        
        String statement = "";
        java.util.Vector result = new java.util.Vector();
        try
        {
            statement = "SELECT group_id FROM groups WHERE display_name = '" + (String)searchCriteria +"';";

            org.osid.sql.ResultTable table = connection.executeQuery(statement);
            
            // make groups from each row
            org.osid.sql.RowIterator rowIterator = table.getRows();
            while (rowIterator.hasNextRow())
            {
                org.osid.shared.ObjectIterator objectIterator = rowIterator.nextRow().getColumns();
                if (objectIterator.hasNextObject())
                {
                    Object o = objectIterator.nextObject();
                    if (o instanceof String)
                    {
                        String idString = (String)o;
                        org.osid.shared.Id id = idManager.getId(idString);
                        result.addElement(new Group(id,idString,connection,log,this.idManager));
                    }
                }
            }
            return new AgentIterator(result);
        }
        catch (Throwable t)
        {
            log(statement);
            log(t.getMessage());
            throw new org.osid.agent.AgentException(org.osid.agent.AgentException.OPERATION_FAILED);
        }
MergeAgentConstructor
        this.id = id;
        this.idString = idString;
        this.connection = connection;
        this.log = log;
        this.idManager = idManager;
        if ( (id == null) || (idString == null) || (connection == null) || (log == null) || (idManager == null) )
        {
            throw new org.osid.agent.AgentException(org.osid.agent.AgentException.NULL_ARGUMENT);
        }
MergeManagerGetAgentSearchTypes
        String statement = "";
        try
        {
            statement = "SELECT authority, domain, keyword, descr FROM agent_search_type;";
            org.osid.sql.ResultTable table = connection.executeQuery(statement);
            java.util.Vector vector = tableToTypes(table);
            return new TypeIterator(vector);
        }
        catch (Throwable t)
        {
            log(statement);
            log(t.getMessage());
            throw new org.osid.agent.AgentException(org.osid.agent.AgentException.OPERATION_FAILED);
        }
MergeManagerGetGroupSearchTypes
        String statement = "";
        try
        {
            statement = "SELECT authority, domain, keyword, descr FROM group_search_type;";
            org.osid.sql.ResultTable table = connection.executeQuery(statement);
            java.util.Vector vector = tableToTypes(table);
            return new TypeIterator(vector);
        }
        catch (Throwable t)
        {
            log(statement);
            log(t.getMessage());
            throw new org.osid.agent.AgentException(org.osid.agent.AgentException.OPERATION_FAILED);
        }
MergeManagerGetPropertySearchTypes
        String statement = "";
        try
        {
            statement = "SELECT authority, domain, keyword, descr FROM properties_type;";
            org.osid.sql.ResultTable table = connection.executeQuery(statement);
            java.util.Vector vector = tableToTypes(table);
            return new TypeIterator(vector);
        }
        catch (Throwable t)
        {
            log(statement);
            log(t.getMessage());
            throw new org.osid.agent.AgentException(org.osid.agent.AgentException.OPERATION_FAILED);
        }
MergeGetAgentsBySearch
        if ( (searchCriteria == null) || (agentSearchType == null) )
        {
            throw new org.osid.agent.AgentException(org.osid.agent.AgentException.NULL_ARGUMENT);
        }

        if (!(agentSearchType.isEqual(this.agentSearchType)))
        {
            throw new org.osid.agent.AgentException(org.osid.agent.AgentException.UNKNOWN_TYPE);
        }
        
        // maybe UNKNNOWN_TYPE is a more appropriate exception than OPERATION_FAILED
        if (!(searchCriteria instanceof String))
        {
            throw new org.osid.agent.AgentException(org.osid.agent.AgentException.UNKNOWN_TYPE);
        }
        
        String statement = "";
        java.util.Vector result = new java.util.Vector();
        try
        {
            String displayName = (String)searchCriteria;
            statement = "SELECT agent_id FROM agent WHERE display_name LIKE " + "'%" + displayName + "%';";
            org.osid.sql.ResultTable table = connection.executeQuery(statement);
            org.osid.sql.RowIterator rowIterator = table.getRows();
            while (rowIterator.hasNextRow())
            {
                org.osid.shared.ObjectIterator objectIterator = rowIterator.nextRow().getColumns();
                if (objectIterator.hasNextObject())
                {
                    Object o = objectIterator.nextObject();
                    if (o instanceof String)
                    {
                        String idString = (String)o;
                        org.osid.shared.Id id = idManager.getId(idString);
                        result.addElement(new Agent(id,idString,connection,log,this.idManager));
                    }
                }
            }
            return new AgentIterator(result);
        }
        catch (Throwable t)
        {
            log(statement);
            log(t.getMessage());
        }
        throw new org.osid.agent.AgentException(org.osid.agent.AgentException.OPERATION_FAILED);
MergeAgentGetDisplayName
        String statement = "";
        try
        {
            statement = "SELECT display_name FROM agent WHERE agent_id = " + "'" + this.idString + "';";
            org.osid.sql.ResultTable table = connection.executeQuery(statement);
            org.osid.sql.RowIterator rowIterator = table.getRows();
            while (rowIterator.hasNextRow())
            {
                org.osid.shared.ObjectIterator objectIterator = rowIterator.nextRow().getColumns();
                if (objectIterator.hasNextObject())
                {
                    Object o = objectIterator.nextObject();
                    if (o instanceof String)
                    {
                        return (String)o;
                    }
                }
            }
        }
        catch (Throwable t)
        {
            log(statement);
            log(t.getMessage());
        }
        throw new org.osid.agent.AgentException(org.osid.agent.AgentException.OPERATION_FAILED);
MergeAgentGetId
        String statement = "";
        try
        {
            statement = "SELECT agent_id FROM agent WHERE agent_id = " + "'" + this.idString + "';";
            org.osid.sql.ResultTable table = connection.executeQuery(statement);
            org.osid.sql.RowIterator rowIterator = table.getRows();
            while (rowIterator.hasNextRow())
            {
                org.osid.shared.ObjectIterator objectIterator = rowIterator.nextRow().getColumns();
                if (objectIterator.hasNextObject())
                {
                    Object o = objectIterator.nextObject();
                    if (o instanceof String)
                    {
                        org.osid.shared.Id id = idManager.getId(idString);
                        return id;
                    }
                }
            }
        }
        catch (Throwable t)
        {
            log(statement);
            log(t.getMessage());
        }
        throw new org.osid.agent.AgentException(org.osid.agent.AgentException.OPERATION_FAILED);
MergeAgentGetType
        String statement = "";
        try
        {
            statement = "SELECT agent_type.authority, agent_type.domain, agent_type.keyword, agent_type.descr FROM agent, agent_type WHERE agent.agent_id = " +
             "'" + this.idString + "' AND agent.agent_type_key = agent_type.agent_type_key;";
            org.osid.sql.ResultTable table = connection.executeQuery(statement);
            java.util.Vector v = tableToTypes(table);
            return (org.osid.shared.Type)v.elementAt(0);
        }
        catch (Throwable t)
        {
            log(statement);
            log(t.getMessage());
        }
        throw new org.osid.agent.AgentException(org.osid.agent.AgentException.OPERATION_FAILED);
MergeAgentGetPropertyTypes
        String statement = "";
        try
        {
            statement = "SELECT properties_type.authority, properties_type.domain, properties_type.keyword, properties_type.description FROM properties_type, agent_properties WHERE agent_properties.agent_id = " + "'" + this.idString + "' AND agent_properties.type_key = properties_type.type_key;";
            org.osid.sql.ResultTable table = connection.executeQuery(statement);
            java.util.Vector vector = tableToTypes(table);
            return new TypeIterator(vector);
        }
        catch (Throwable t)
        {
            log(statement);
            log(t.getMessage());
            throw new org.osid.agent.AgentException(org.osid.agent.AgentException.OPERATION_FAILED);
        }
MergeAgentGetProperties
        String statement = "";
        java.util.Vector results = new java.util.Vector();
        try
        {
            org.osid.shared.TypeIterator typeIterator = getPropertyTypes();
            while (typeIterator.hasNextType())
            {
                org.osid.shared.Type nextType = typeIterator.nextType();
                org.osid.shared.Type type = new Type("mit.edu","agent_properties","simple_person");
                if (nextType.isEqual(type))
                {
                    java.util.Map map = new java.util.HashMap();
                    statement = "SELECT lastname, firstname, email, creation_date, modified_date, modified_by FROM agent WHERE agent_id = " + "'" + this.idString + "';";
                    org.osid.sql.ResultTable table = connection.executeQuery(statement);
                    org.osid.sql.RowIterator rowIterator = table.getRows();
                    while (rowIterator.hasNextRow())
                    {
                        org.osid.shared.ObjectIterator objectIterator = rowIterator.nextRow().getColumns();
                        if (objectIterator.hasNextObject())
                        {
                            Object o = objectIterator.nextObject();
                            if (o instanceof String)
                            {
                                String val = (String)o; 
                                map.put("lastname",val);
                            }
                        }
                        if (objectIterator.hasNextObject())
                        {
                            Object o = objectIterator.nextObject();
                            if (o instanceof String)
                            {
                                String val = (String)o; 
                                map.put("firstname",val);
                            }
                        }
                        if (objectIterator.hasNextObject())
                        {
                            Object o = objectIterator.nextObject();
                            if (o instanceof String)
                            {
                                String val = (String)o; 
                                map.put("email",val);
                            }
                        }
                        if (objectIterator.hasNextObject())
                        {
                            Object o = objectIterator.nextObject();
                            if (o instanceof java.util.Date)
                            {
                                java.util.Calendar calendar = java.util.Calendar.getInstance();
                                calendar.setTime((java.util.Date)o);
                                map.put("creation_date",new Long(calendar.getTimeInMillis()));
                            }
                        }
                        if (objectIterator.hasNextObject())
                        {
                            Object o = objectIterator.nextObject();
                            if (o instanceof java.util.Date)
                            {
                                java.util.Calendar calendar = java.util.Calendar.getInstance();
                                calendar.setTime((java.util.Date)o);
                                map.put("modified_date",new Long(calendar.getTimeInMillis()));
                            }
                        }
                        if (objectIterator.hasNextObject())
                        {
                            Object o = objectIterator.nextObject();
                            if (o instanceof String)
                            {
                                String val = (String)o;
                                map.put("modified_by",this.idManager.getId(val));
                            }
                        }
                    }
                    results.addElement(new SharedProperties(map,type));
                }
            }
            return new SharedPropertiesIterator(results);
        }
        catch (Throwable t)
        {
            log(statement);
            log(t.getMessage());
            throw new org.osid.agent.AgentException(org.osid.agent.AgentException.OPERATION_FAILED);
        }
MergeAgentGetPropertiesByType
        String statement = "";
        
        try
        {
            boolean found = false;
            org.osid.shared.TypeIterator typeIterator = getPropertyTypes();
            while (typeIterator.hasNextType())
            {
                org.osid.shared.Type nextType = typeIterator.nextType();
                if (propertiesType.isEqual(nextType))
                {
                    found = true;
                    break;
                }
            }
            if (found)
            {
                java.util.Map map = new java.util.HashMap();
                statement = "SELECT lastname, firstname, email, creation_date, modified_date, modified_by FROM agent WHERE agent_id = " + "'" + this.idString + "';";
                org.osid.sql.ResultTable table = connection.executeQuery(statement);
                org.osid.sql.RowIterator rowIterator = table.getRows();
                while (rowIterator.hasNextRow())
                {
                    org.osid.shared.ObjectIterator objectIterator = rowIterator.nextRow().getColumns();
                    if (objectIterator.hasNextObject())
                    {
                        Object o = objectIterator.nextObject();
                        if (o instanceof String)
                        {
                            String val = (String)o; 
                            map.put("lastname",val);
                        }
                    }
                    if (objectIterator.hasNextObject())
                    {
                        Object o = objectIterator.nextObject();
                        if (o instanceof String)
                        {
                            String val = (String)o; 
                            map.put("firstname",val);
                        }
                    }
                    if (objectIterator.hasNextObject())
                    {
                        Object o = objectIterator.nextObject();
                        if (o instanceof String)
                        {
                            String val = (String)o; 
                            map.put("email",val);
                        }
                    }
                    if (objectIterator.hasNextObject())
                    {
                        Object o = objectIterator.nextObject();
                        if (o instanceof java.util.Date)
                        {
                            java.util.Calendar calendar = java.util.Calendar.getInstance();
                            calendar.setTime((java.util.Date)o);
                            map.put("creation_date",new Long(calendar.getTimeInMillis()));
                        }
                    }
                    if (objectIterator.hasNextObject())
                    {
                        Object o = objectIterator.nextObject();
                        if (o instanceof java.util.Date)
                        {
                            java.util.Calendar calendar = java.util.Calendar.getInstance();
                            calendar.setTime((java.util.Date)o);
                            map.put("modified_date",new Long(calendar.getTimeInMillis()));
                        }
                    }
                    if (objectIterator.hasNextObject())
                    {
                        Object o = objectIterator.nextObject();
                        if (o instanceof String)
                        {
                            String val = (String)o;
                            map.put("modified_by",this.idManager.getId(val));
                        }
                    }
                }
                return new SharedProperties(map,propertiesType);
            }
        }
        catch (Throwable t)
        {
            t.printStackTrace();
            log(statement);
            log(t.getMessage());
            throw new org.osid.agent.AgentException(org.osid.agent.AgentException.OPERATION_FAILED);
        }
        throw new org.osid.agent.AgentException(org.osid.agent.AgentException.UNKNOWN_TYPE);
MergeGroupConstructor
        this.id = id;
        this.idString = idString;
        this.connection = connection;
        this.log = log;
        this.idManager = idManager;
        if ( (id == null) || (idString == null) || (connection == null) || (log == null) || (idManager == null) )
        {
            throw new org.osid.agent.AgentException(org.osid.agent.AgentException.NULL_ARGUMENT);
        }
MergeGroupGetDisplayName
        String statement = "";
        try
        {
            statement = "SELECT display_name FROM groups WHERE group_id = " + "'" + this.idString + "';";
            org.osid.sql.ResultTable table = connection.executeQuery(statement);
            org.osid.sql.RowIterator rowIterator = table.getRows();
            while (rowIterator.hasNextRow())
            {
                org.osid.shared.ObjectIterator objectIterator = rowIterator.nextRow().getColumns();
                if (objectIterator.hasNextObject())
                {
                    Object o = objectIterator.nextObject();
                    if (o instanceof String)
                    {
                        return (String)o;
                    }
                }
            }
        }
        catch (Throwable t)
        {
            log(statement);
            log(t.getMessage());
        }
        throw new org.osid.agent.AgentException(org.osid.agent.AgentException.OPERATION_FAILED);
MergeGroupGetDescription
        String statement = "";
        try
        {
            statement = "SELECT description FROM groups WHERE group_id = " + "'" + this.idString + "';";
            org.osid.sql.ResultTable table = connection.executeQuery(statement);
            org.osid.sql.RowIterator rowIterator = table.getRows();
            while (rowIterator.hasNextRow())
            {
                org.osid.shared.ObjectIterator objectIterator = rowIterator.nextRow().getColumns();
                if (objectIterator.hasNextObject())
                {
                    Object o = objectIterator.nextObject();
                    if (o instanceof String)
                    {
                        return (String)o;
                    }
                }
            }
        }
        catch (Throwable t)
        {
            log(statement);
            log(t.getMessage());
        }
        throw new org.osid.agent.AgentException(org.osid.agent.AgentException.OPERATION_FAILED);
MergeGroupUpdateDescription
        if (description == null) 
        {
            throw new org.osid.agent.AgentException(org.osid.agent.AgentException.NULL_ARGUMENT);
        }
        int result = -1;
        String statement = "";
        try
        {
            statement = "UPDATE groups SET description = '" + description + "' WHERE group_id = '" + this.idString + "';";
            result = connection.executeUpdate(statement);
        }
        catch (Throwable t)
        {
            log(statement);
            log(t.getMessage());
            throw new org.osid.agent.AgentException(org.osid.agent.AgentException.OPERATION_FAILED);
        }
        if (result == 0)
        {    
            throw new org.osid.agent.AgentException(org.osid.agent.AgentException.OPERATION_FAILED);
        }
MergeGroupGetId
        String statement = "";
        try
        {
            statement = "SELECT group_id FROM groups WHERE group_id = " + "'" + this.idString + "';";
            org.osid.sql.ResultTable table = connection.executeQuery(statement);
            org.osid.sql.RowIterator rowIterator = table.getRows();
            while (rowIterator.hasNextRow())
            {
                org.osid.shared.ObjectIterator objectIterator = rowIterator.nextRow().getColumns();
                if (objectIterator.hasNextObject())
                {
                    Object o = objectIterator.nextObject();
                    if (o instanceof String)
                    {
                        org.osid.shared.Id id = idManager.getId(idString);
                        return id;
                    }
                }
            }
        }
        catch (Throwable t)
        {
            log(statement);
            log(t.getMessage());
        }
        throw new org.osid.agent.AgentException(org.osid.agent.AgentException.OPERATION_FAILED);
MergeGroupGetType
        String statement = "";
        try
        {
            statement = "SELECT group_type.authority, group_type.domain, group_type.keyword, group_type.descr FROM groups, group_type WHERE groups.group_id = " +
             "'" + this.idString + "' AND groups.group_type_key = group_type.group_type_key;";
            org.osid.sql.ResultTable table = connection.executeQuery(statement);
            java.util.Vector v = tableToTypes(table);
            return (org.osid.shared.Type)v.elementAt(0);
        }
        catch (Throwable t)
        {
            log(statement);
            log(t.getMessage());
        }
        throw new org.osid.agent.AgentException(org.osid.agent.AgentException.OPERATION_FAILED);
MergeGroupAdd
        if (memberOrGroup == null) 
        {
            throw new org.osid.agent.AgentException(org.osid.agent.AgentException.NULL_ARGUMENT);
        }

        String isGroup = (memberOrGroup instanceof org.osid.agent.Group) ? "true" : "false";
        String statement = "";

        boolean alreadyAdded = false;
        // test if already added
        try
        {
            statement = "SELECT group_id FROM group_member WHERE group_id = '" + 
                        this.idString + "' AND member_id = '" + memberOrGroup.getId().getIdString() + "';";
            org.osid.sql.ResultTable table = connection.executeQuery(statement);
            org.osid.sql.RowIterator rowIterator = table.getRows();
            alreadyAdded = (rowIterator.hasNextRow());
        }
        catch (Throwable t)
        {
            log(statement);
            log(t.getMessage());
            throw new org.osid.agent.AgentException(org.osid.agent.AgentException.OPERATION_FAILED);
        }

        if (alreadyAdded)
        {
            throw new org.osid.agent.AgentException(org.osid.agent.AgentException.ALREADY_ADDED);
        }
        
        try
        {
            statement = "INSERT INTO group_member (group_id, member_id, isgroup) VALUES ('" 
                        + this.idString + "','" + memberOrGroup.getId().getIdString() + "','" + isGroup + "');";
            this.connection.executeUpdate(statement);
        }
        catch (Throwable t)
        {
            log(statement);
            log(t.getMessage());
            throw new org.osid.agent.AgentException(org.osid.agent.AgentException.OPERATION_FAILED);
        }
MergeGroupRemove
        if (memberOrGroup == null) 
        {
            throw new org.osid.agent.AgentException(org.osid.agent.AgentException.NULL_ARGUMENT);
        }

        String statement = "";
        int result = -1;
        try
        {
            statement = "DELETE FROM group_member WHERE group_id = '" + this.idString + 
            "'" + " AND member_id = '" + memberOrGroup.getId().getIdString() + "';";
            result = connection.executeUpdate(statement);
        }
        catch(Throwable t)
        {
            log(statement);
            log(t.getMessage());
            throw new org.osid.agent.AgentException(org.osid.agent.AgentException.OPERATION_FAILED);
        }
        if (result == 0)
        {
            throw new org.osid.agent.AgentException(org.osid.agent.AgentException.UNKNOWN_ID);
        }        
MergeGroupGetMembers
        String statement = "";
        java.util.Vector result = new java.util.Vector();
        try
        {
            // accumlate members for this group
            statement = "SELECT member_id, isgroup FROM group_member WHERE group_id = '" + this.idString + "';";
            org.osid.sql.ResultTable table = connection.executeQuery(statement);
            org.osid.sql.RowIterator rowIterator = table.getRows();
            while (rowIterator.hasNextRow())
            {
                org.osid.shared.ObjectIterator objectIterator = rowIterator.nextRow().getColumns();
                if (objectIterator.hasNextObject())
                {
                    Object o = objectIterator.nextObject();
                    if (o instanceof String)
                    {
                        String idString = (String)o;
                        org.osid.shared.Id id = idManager.getId(idString);
                        o = objectIterator.nextObject();
                        boolean isGroup = false;
                        if (o instanceof Boolean)
                        {
                            isGroup = ((Boolean)o).booleanValue();
                            if (isGroup)
                            {
                                result.addElement(new Group(id,idString,connection,log,this.idManager));
                            }
                            else
                            {
                                result.addElement(new Agent(id,idString,connection,log,this.idManager));
                            }
                        }
                    }
                }
            }
            if (includeSubgroups)
            {
                // get the subgroups of this group and accumulate their members, recursively
                org.osid.agent.AgentIterator groupIterator = getGroups(false);
                while (groupIterator.hasNextAgent())
                {
                    org.osid.agent.AgentIterator memberIterator = ((org.osid.agent.Group)groupIterator.nextAgent()).getMembers(true);
                    while (memberIterator.hasNextAgent())
                    {
                        result.addElement(memberIterator.nextAgent());
                    }
                }
            }
            return new AgentIterator(result);
        }
        catch (Throwable t)
        {
            log(statement);
            log(t.getMessage());
            throw new org.osid.agent.AgentException(org.osid.agent.AgentException.OPERATION_FAILED);
        }
MergeGroupGetGroups
        String statement = "";
        java.util.Vector result = new java.util.Vector();
        try
        {
            // accumualte groups for this group
            statement = "SELECT member_id, isgroup FROM group_member WHERE group_id = '" + this.idString + "';";
            org.osid.sql.ResultTable table = connection.executeQuery(statement);
            org.osid.sql.RowIterator rowIterator = table.getRows();
            while (rowIterator.hasNextRow())
            {
                org.osid.shared.ObjectIterator objectIterator = rowIterator.nextRow().getColumns();
                if (objectIterator.hasNextObject())
                {
                    Object o = objectIterator.nextObject();
                    if (o instanceof String)
                    {
                        String idString = (String)o;
                        org.osid.shared.Id id = idManager.getId(idString);
                        o = objectIterator.nextObject();
                        boolean isGroup = false;
                        if (o instanceof Boolean)
                        {
                            isGroup = ((Boolean)o).booleanValue();
                            if (isGroup)
                            {
                                result.addElement(new Group(id,idString,connection,log,this.idManager));
                            }
                        }
                    }
                }
            }
            if (includeSubgroups)
            {
                // get the subgroups of this group and accumulate their groups, recursively
                org.osid.agent.AgentIterator groupIterator = getGroups(false);
                while (groupIterator.hasNextAgent())
                {
                    org.osid.agent.AgentIterator subgroupIterator = ((org.osid.agent.Group)groupIterator.nextAgent()).getGroups(true);
                    while (subgroupIterator.hasNextAgent())
                    {
                        result.addElement(subgroupIterator.nextAgent());
                    }
                }
            }
            return new AgentIterator(result);
        }
        catch (Throwable t)
        {
            log(statement);
            log(t.getMessage());
            throw new org.osid.agent.AgentException(org.osid.agent.AgentException.OPERATION_FAILED);
        }
MergeGroupContainsMember
        if (memberOrGroup == null)
        {
            throw new org.osid.agent.AgentException(org.osid.agent.AgentException.NULL_ARGUMENT);
        }
        String statement = "";
        boolean found = false; 
        try
        {
            // look in this group
            statement = "SELECT member_id FROM group_member WHERE group_id = '" + this.idString + "';";
            org.osid.sql.ResultTable table = connection.executeQuery(statement);
            org.osid.sql.RowIterator rowIterator = table.getRows();
            found = (rowIterator.hasNextRow());
            
            if (searchSubgroups && (!found))
            {
                // get the subgroups of this group and check their groups, recursively
                org.osid.agent.AgentIterator groupIterator = getGroups(false);
                while (groupIterator.hasNextAgent())
                {
                    boolean subgroupContains = ((org.osid.agent.Group)groupIterator.nextAgent()).contains(memberOrGroup,true);
                    if (subgroupContains)
                    {
                        return true;
                    }
                }
            }
            return found;
        }
        catch (Throwable t)
        {
            log(statement);
            log(t.getMessage());
            throw new org.osid.agent.AgentException(org.osid.agent.AgentException.OPERATION_FAILED);
        }
MergeGroupGetPropertyTypes
        String statement = "";
        try
        {
            statement = "SELECT properties_type.authority, properties_type.domain, properties_type.keyword, properties_type.description FROM properties_type, groupx_properties WHERE groupx_properties.group_id = " + "'" + this.idString + "' AND groupx_properties.properties_type_key = properties_type.properties_type_key;";
            org.osid.sql.ResultTable table = connection.executeQuery(statement);
            java.util.Vector vector = tableToTypes(table);
            return new TypeIterator(vector);
        }
        catch (Throwable t)
        {
            log(statement);
            log(t.getMessage());
            throw new org.osid.agent.AgentException(org.osid.agent.AgentException.OPERATION_FAILED);
        }
MergeGroupGetProperties
        String statement = "";
        java.util.Vector results = new java.util.Vector();
        try
        {
            org.osid.shared.TypeIterator typeIterator = getPropertyTypes();
            while (typeIterator.hasNextType())
            {
                org.osid.shared.Type nextType = typeIterator.nextType();
                org.osid.shared.Type type = new Type("properties","mit.edu","mailing_list");
                if (nextType.isEqual(type))
                {
                    java.util.Map map = new java.util.HashMap();
                    statement = "SELECT mailing_list FROM mailing_list_properties WHERE group_id = " + "'" + this.idString + "';";
                    org.osid.sql.ResultTable table = connection.executeQuery(statement);
                    org.osid.sql.RowIterator rowIterator = table.getRows();
                    while (rowIterator.hasNextRow())
                    {
                        org.osid.shared.ObjectIterator objectIterator = rowIterator.nextRow().getColumns();
                        if (objectIterator.hasNextObject())
                        {
                            Object o = objectIterator.nextObject();
                            if (o instanceof String)
                            {
                                String mailingList = (String)o; 
                                map.put("mailing_list", mailingList);
                            }
                        }
                    }
                    results.addElement(new SharedProperties(map,type));
                }
            }
            return new SharedPropertiesIterator(results);
        }
        catch (Throwable t)
        {
            log(statement);
            log(t.getMessage());
            throw new org.osid.agent.AgentException(org.osid.agent.AgentException.OPERATION_FAILED);
        }
MergeGroupGetPropertiesByType
        String statement = "";
        
        try
        {
            boolean found = false;
            org.osid.shared.TypeIterator typeIterator = getPropertyTypes();
            while (typeIterator.hasNextType())
            {
                org.osid.shared.Type nextType = typeIterator.nextType();
                if (propertiesType.isEqual(nextType))
                {
                    found = true;
                    break;
                }
            }
            if (!found)
            {
                throw new org.osid.agent.AgentException(org.osid.agent.AgentException.UNKNOWN_TYPE);
            }
            
            org.osid.shared.Type type = new Type("properties","mit.edu","mailing_list");
            if (propertiesType.isEqual(type))
            {
                java.util.Map map = new java.util.HashMap();
                statement = "SELECT mailing_list FROM mailing_list_properties WHERE group_id = " + "'" + this.idString + "';";
                org.osid.sql.ResultTable table = connection.executeQuery(statement);
                org.osid.sql.RowIterator rowIterator = table.getRows();
                while (rowIterator.hasNextRow())
                {
                    org.osid.shared.ObjectIterator objectIterator = rowIterator.nextRow().getColumns();
                    if (objectIterator.hasNextObject())
                    {
                        Object o = objectIterator.nextObject();
                        if (o instanceof String)
                        {
                            String mailingList = (String)o; 
                            map.put("mailing_list",mailingList);
                        }
                    }
                }
                return new SharedProperties(map,type);
            }
            return new SharedProperties();
        }
        catch (Throwable t)
        {
            log(statement);
            log(t.getMessage());
            throw new org.osid.agent.AgentException(org.osid.agent.AgentException.OPERATION_FAILED);
        }
MergeAgentIteratorNext
        if (i < vector.size())
        {
            return (org.osid.agent.Agent)vector.elementAt(i++);
        }
        else
        {
            throw new org.osid.agent.AgentException(org.osid.agent.AgentException.NO_MORE_ITERATOR_ELEMENTS);
        }
MergeTypeIteratorNext
        if (i < vector.size())
        {
            return (org.osid.shared.Type)vector.elementAt(i++);
        }
        else
        {
            throw new org.osid.shared.SharedException(org.osid.shared.SharedException.NO_MORE_ITERATOR_ELEMENTS);
        }
MergePropertiesIteratorNext
        if (i < vector.size())
        {
            return (org.osid.shared.Properties)vector.elementAt(i++);
        }
        else
        {
            throw new org.osid.shared.SharedException(org.osid.shared.SharedException.NO_MORE_ITERATOR_ELEMENTS);
        }
MergePropertiesConstructor
        this.map = map;
        this.type = type;
MergePropertiesGetKeys
        return new ObjectIterator(new java.util.Vector(this.map.keySet()));
MergePropertiesGetProperty
        if (this.map.containsKey(key))
        {
            return (java.io.Serializable)this.map.get(key);
        }
        else
        {
            throw new org.osid.shared.SharedException(org.osid.shared.SharedException.UNKNOWN_KEY);
        }
MergePropertiesGetType
        return this.type;
MergeObjectIteratorNext
        if (i < vector.size())
        {
            return (java.io.Serializable)vector.elementAt(i++);
        }
        else
        {
            throw new org.osid.shared.SharedException(org.osid.shared.SharedException.NO_MORE_ITERATOR_ELEMENTS);
        }