def execute(self, statement, parameters=None):
        """
        Execute a SQL statement string with the given parameters.
        'parameters' is a sequence when the parameter style is
        'format', 'numeric' or 'qmark', and a dictionary when the
        style is 'pyformat' or 'named'. See ``DB.paramstyle()``.

        :Parameters:
            statement : str
                the SQL statement to execute
            parameters : list
                parameters to use, if the statement is parameterized

        :raise Warning: Non-fatal warning
        :raise Error:   Error
        """
        dbi = self.__driver.get_import()
        try:
            if parameters:
                result = self.__cursor.execute(statement, parameters)
            else:
                result = self.__cursor.execute(statement)

            try:
                self.__rowcount = self.__cursor.rowcount
            except __HOLE__:
                self.__rowcount = -1
            self.__description = self.__cursor.description
            return result
        except dbi.Warning, val:
            raise Warning(val)
        except dbi.Error, val:
            raise Error(val)
        except:
            raise Error(sys.exc_info()[1])
dataset/ETHPy150Open AppScale/appscale/AppServer/lib/grizzled/grizzled/db/base.py/Cursor.execute