當前位置: 首頁>>代碼示例>>Java>>正文


Java ShowDataSource類代碼示例

本文整理匯總了Java中com.alibaba.cobar.manager.response.ShowDataSource的典型用法代碼示例。如果您正苦於以下問題:Java ShowDataSource類的具體用法?Java ShowDataSource怎麽用?Java ShowDataSource使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ShowDataSource類屬於com.alibaba.cobar.manager.response包,在下文中一共展示了ShowDataSource類的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: handle

import com.alibaba.cobar.manager.response.ShowDataSource; //導入依賴的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.ShowDataSource類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。