当前位置: 首页>>代码示例>>Java>>正文


Java ShowConnection类代码示例

本文整理汇总了Java中com.alibaba.cobar.manager.response.ShowConnection的典型用法代码示例。如果您正苦于以下问题:Java ShowConnection类的具体用法?Java ShowConnection怎么用?Java ShowConnection使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ShowConnection类属于com.alibaba.cobar.manager.response包,在下文中一共展示了ShowConnection类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: handle

import com.alibaba.cobar.manager.response.ShowConnection; //导入依赖的package包/类
public static void handle(String stmt, ManagerConnection c, int offset) {
    int rs = ManagerParseShow.parse(stmt, offset);
    switch (rs & 0xff) {
        case ManagerParseShow.COMMAND:
            ShowCommand.execute(c);
            break;
        case ManagerParseShow.COLLATION:
            ShowCollation.execute(c);
            break;
        case ManagerParseShow.CONNECTION:
            ShowConnection.execute(c);
            break;
        case ManagerParseShow.CONNECTION_SQL:
            ShowConnectionSQL.execute(c);
            break;
        case ManagerParseShow.DATABASE:
            ShowDatabase.execute(c);
            break;
        case ManagerParseShow.DATASOURCE:
            ShowDataSource.execute(c, null);
            break;
        case ManagerParseShow.DATASOURCE_WHERE: {
            String name = stmt.substring(rs >>> 8).trim();
            if (StringUtil.isEmpty(name)) {
                c.writeErrMessage(ErrorCode.ER_YES, "Unsupported statement");
            } else {
                // ShowDataSource.execute(c, name);
            }
            break;
        }
        case ManagerParseShow.HELP:
            ShowHelp.execute(c);
            break;
        case ManagerParseShow.PARSER:
            ShowParser.execute(c);
            break;
        case ManagerParseShow.PROCESSOR:
            ShowProcessor.execute(c);
            break;
        case ManagerParseShow.ROUTER:
            ShowRouter.execute(c);
            break;
        case ManagerParseShow.SERVER:
            ShowServer.execute(c);
            break;
        case ManagerParseShow.SQL:
            ShowSQL.execute(c, ParseUtil.getSQLId(stmt));
            break;
        case ManagerParseShow.SQL_DETAIL:
            ShowSQLDetail.execute(c, ParseUtil.getSQLId(stmt));
            break;
        case ManagerParseShow.SQL_EXECUTE:
            ShowSQLExecute.execute(c);
            break;
        // case ManagerParseShow.SQL_SLOW:
        // ShowSQLSlow.execute(c);
        // break;

        case ManagerParseShow.THREADPOOL:
            ShowThreadPool.execute(c);
            break;
        case ManagerParseShow.TIME_CURRENT:
            ShowTime.execute(c, ManagerParseShow.TIME_CURRENT);
            break;
        case ManagerParseShow.TIME_STARTUP:
            ShowTime.execute(c, ManagerParseShow.TIME_STARTUP);
            break;
        case ManagerParseShow.VARIABLES:
            ShowVariables.execute(c);
            break;
        case ManagerParseShow.VERSION:
            ShowVersion.execute(c);
            break;
        default:
            c.writeErrMessage(ErrorCode.ER_YES, "Unsupported statement");
    }
}
 
开发者ID:loye168,项目名称:tddl5,代码行数:78,代码来源:ShowHandler.java


注:本文中的com.alibaba.cobar.manager.response.ShowConnection类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。