Execute sql

        :param sql string: the sql stamtement like 'select * from %s'
        :param args  list: Wen set None, will use dbi execute(sql), else
            db execute(sql, args), the args keep the original rules, it shuld be tuple or list of list

def execute(self, sql, args):
        """Execute sql

        :param sql string: the sql stamtement like 'select * from %s'
        :param args  list: Wen set None, will use dbi execute(sql), else
            db execute(sql, args), the args keep the original rules, it shuld be tuple or list of list
        """
        c = None
        try:
            c = self._con.cursor()
            LOGGER.debug("execute sql: " + sql + " args:" + str(args))
            if type(args) is tuple:
                c.execute(sql, args)
            elif type(args) is list:
                if len(args) > 1 and type(args[0]) in (list, tuple):
                    c.executemany(sql, args)
                else:
                    c.execute(sql, args)
            elif args is None:
                c.execute(sql)
            if sql.lstrip()[:6].upper() == 'INSERT':
                return c.lastrowid
            return c.rowcount
        finally:
            c and c.close()