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


Java SavepointHandler类代码示例

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


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

示例1: query

import com.alibaba.cobar.server.handler.SavepointHandler; //导入依赖的package包/类
@Override
public void query(String sql) {
    ServerConnection c = this.source;
    if (logger.isInfoEnabled()) {
        logger.info(sql);
    }
    int rs = ServerParse.parse(sql);
    switch (rs & 0xff) {
        case ServerParse.SET:
            SetHandler.handle(sql, c, rs >>> 8);
            break;
        case ServerParse.SHOW:
            ShowHandler.handle(sql, c, rs >>> 8);
            break;
        case ServerParse.SELECT:
            SelectHandler.handle(sql, c, rs >>> 8);
            break;
        case ServerParse.START:
            StartHandler.handle(sql, c, rs >>> 8);
            break;
        case ServerParse.BEGIN:
            BeginHandler.handle(sql, c);
            break;
        case ServerParse.LOAD:
            LoadHandler.handle(sql, c);
            break;
        case ServerParse.SAVEPOINT:
            SavepointHandler.handle(sql, c);
            break;
        case ServerParse.USE:
            UseHandler.handle(sql, c, rs >>> 8);
            break;
        case ServerParse.COMMIT:
            c.commit();
            break;
        case ServerParse.ROLLBACK:
            c.rollback();
            break;
        default:
            c.execute(sql, rs);
    }
}
 
开发者ID:loye168,项目名称:tddl5,代码行数:43,代码来源:ServerQueryHandler.java

示例2: query

import com.alibaba.cobar.server.handler.SavepointHandler; //导入依赖的package包/类
@Override
public void query(String sql) {
    ServerConnection c = this.source;
    if (LOGGER.isDebugEnabled()) {
        LOGGER.debug(new StringBuilder().append(c).append(sql).toString());
    }
    int rs = ServerParse.parse(sql);
    switch (rs & 0xff) {
    case ServerParse.EXPLAIN:
        ExplainHandler.handle(sql, c, rs >>> 8);
        break;
    case ServerParse.SET:
        SetHandler.handle(sql, c, rs >>> 8);
        break;
    case ServerParse.SHOW:
        ShowHandler.handle(sql, c, rs >>> 8);
        break;
    case ServerParse.SELECT:
        SelectHandler.handle(sql, c, rs >>> 8);
        break;
    case ServerParse.START:
        StartHandler.handle(sql, c, rs >>> 8);
        break;
    case ServerParse.BEGIN:
        BeginHandler.handle(sql, c);
        break;
    case ServerParse.SAVEPOINT:
        SavepointHandler.handle(sql, c);
        break;
    case ServerParse.KILL:
        KillHandler.handle(sql, rs >>> 8, c);
        break;
    case ServerParse.KILL_QUERY:
        c.writeErrMessage(ErrorCode.ER_UNKNOWN_COM_ERROR, "Unsupported command");
        break;
    case ServerParse.USE:
        UseHandler.handle(sql, c, rs >>> 8);
        break;
    case ServerParse.COMMIT:
        c.commit();
        break;
    case ServerParse.ROLLBACK:
        c.rollback();
        break;
    default:
        c.execute(sql, rs);
    }
}
 
开发者ID:alibaba,项目名称:cobar,代码行数:49,代码来源:ServerQueryHandler.java


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