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


Java ServerParseSelect.indexAfterLastInsertIdFunc方法代码示例

本文整理汇总了Java中com.alibaba.cobar.server.parser.ServerParseSelect.indexAfterLastInsertIdFunc方法的典型用法代码示例。如果您正苦于以下问题:Java ServerParseSelect.indexAfterLastInsertIdFunc方法的具体用法?Java ServerParseSelect.indexAfterLastInsertIdFunc怎么用?Java ServerParseSelect.indexAfterLastInsertIdFunc使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.alibaba.cobar.server.parser.ServerParseSelect的用法示例。


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

示例1: handle

import com.alibaba.cobar.server.parser.ServerParseSelect; //导入方法依赖的package包/类
public static void handle(String stmt, ServerConnection c, int offs) {
    int offset = offs;
    switch (ServerParseSelect.parse(stmt, offs)) {
        case ServerParseSelect.VERSION_COMMENT:
            SelectVersionComment.response(c);
            break;
        case ServerParseSelect.DATABASE:
            SelectDatabase.response(c);
            break;
        case ServerParseSelect.USER:
            SelectUser.response(c);
            break;
        case ServerParseSelect.VERSION:
            SelectVersion.response(c);
            break;
        case ServerParseSelect.LAST_INSERT_ID:
            // offset = ParseUtil.move(stmt, 0, "select".length());
            loop: for (; offset < stmt.length(); ++offset) {
                switch (stmt.charAt(offset)) {
                    case ' ':
                        continue;
                    case '/':
                    case '#':
                        offset = ParseUtil.comment(stmt, offset);
                        continue;
                    case 'L':
                    case 'l':
                        break loop;
                }
            }
            offset = ServerParseSelect.indexAfterLastInsertIdFunc(stmt, offset);
            offset = ServerParseSelect.skipAs(stmt, offset);
            SelectLastInsertId.response(c, stmt, offset);
            break;
        case ServerParseSelect.IDENTITY:
            // offset = ParseUtil.move(stmt, 0, "select".length());
            loop: for (; offset < stmt.length(); ++offset) {
                switch (stmt.charAt(offset)) {
                    case ' ':
                        continue;
                    case '/':
                    case '#':
                        offset = ParseUtil.comment(stmt, offset);
                        continue;
                    case '@':
                        break loop;
                }
            }
            int indexOfAtAt = offset;
            offset += 2;
            offset = ServerParseSelect.indexAfterIdentity(stmt, offset);
            String orgName = stmt.substring(indexOfAtAt, offset);
            offset = ServerParseSelect.skipAs(stmt, offset);
            SelectIdentity.response(c, stmt, offset, orgName);
            break;
        default:
            c.execute(stmt, ServerParse.SELECT);
    }
}
 
开发者ID:loye168,项目名称:tddl5,代码行数:60,代码来源:SelectHandler.java

示例2: handle

import com.alibaba.cobar.server.parser.ServerParseSelect; //导入方法依赖的package包/类
public static void handle(String stmt, ServerConnection c, int offs) {
    int offset = offs;
    switch (ServerParseSelect.parse(stmt, offs)) {
    case ServerParseSelect.VERSION_COMMENT:
        SelectVersionComment.response(c);
        break;
    case ServerParseSelect.DATABASE:
        SelectDatabase.response(c);
        break;
    case ServerParseSelect.USER:
        SelectUser.response(c);
        break;
    case ServerParseSelect.VERSION:
        SelectVersion.response(c);
        break;
    case ServerParseSelect.LAST_INSERT_ID:
        // offset = ParseUtil.move(stmt, 0, "select".length());
        loop: for (; offset < stmt.length(); ++offset) {
            switch (stmt.charAt(offset)) {
            case ' ':
                continue;
            case '/':
            case '#':
                offset = ParseUtil.comment(stmt, offset);
                continue;
            case 'L':
            case 'l':
                break loop;
            }
        }
        offset = ServerParseSelect.indexAfterLastInsertIdFunc(stmt, offset);
        offset = ServerParseSelect.skipAs(stmt, offset);
        SelectLastInsertId.response(c, stmt, offset);
        break;
    case ServerParseSelect.IDENTITY:
        // offset = ParseUtil.move(stmt, 0, "select".length());
        loop: for (; offset < stmt.length(); ++offset) {
            switch (stmt.charAt(offset)) {
            case ' ':
                continue;
            case '/':
            case '#':
                offset = ParseUtil.comment(stmt, offset);
                continue;
            case '@':
                break loop;
            }
        }
        int indexOfAtAt = offset;
        offset += 2;
        offset = ServerParseSelect.indexAfterIdentity(stmt, offset);
        String orgName = stmt.substring(indexOfAtAt, offset);
        offset = ServerParseSelect.skipAs(stmt, offset);
        SelectIdentity.response(c, stmt, offset, orgName);
        break;
    default:
        c.execute(stmt, ServerParse.SELECT);
    }
}
 
开发者ID:alibaba,项目名称:cobar,代码行数:60,代码来源:SelectHandler.java


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