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


Java RowSetNavigator.hasNext方法代码示例

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


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

示例1: readDDL

import org.hsqldb.navigator.RowSetNavigator; //导入方法依赖的package包/类
protected void readDDL(Session session) throws IOException {

        Result r = Result.newResult(dataStreamIn, rowIn);

        r.readAdditionalResults(session, dataStreamIn, rowIn);

        RowSetNavigator nav = r.initialiseNavigator();

        while (nav.hasNext()) {
            Object[] data   = (Object[]) nav.getNext();
            String   s      = (String) data[0];
            Result   result = session.executeDirectStatement(s);

            if (result.isError()) {
                db.logger.appLog.logContext(SimpleLog.LOG_ERROR,
                                            result.getMainString());

                throw Error.error(result);
            }
        }
    }
 
开发者ID:s-store,项目名称:s-store,代码行数:22,代码来源:ScriptReaderBinary.java

示例2: getInsertSelectNavigator

import org.hsqldb.navigator.RowSetNavigator; //导入方法依赖的package包/类
RowSetNavigator getInsertSelectNavigator(Session session) {

        Type[] colTypes  = baseTable.getColumnTypes();
        int[]  columnMap = insertColumnMap;

        //
        Result                result = queryExpression.getResult(session, 0);
        RowSetNavigator       nav         = result.initialiseNavigator();
        Type[]                sourceTypes = result.metaData.columnTypes;
        RowSetNavigatorClient newData     = new RowSetNavigatorClient(2);

        while (nav.hasNext()) {
            Object[] data       = baseTable.getNewRowData(session);
            Object[] sourceData = (Object[]) nav.getNext();

            for (int i = 0; i < columnMap.length; i++) {
                int  j          = columnMap[i];
                Type sourceType = sourceTypes[i];

                data[j] = colTypes[j].convertToType(session, sourceData[i],
                                                    sourceType);
            }

            newData.add(data);
        }

        return newData;
    }
 
开发者ID:s-store,项目名称:s-store,代码行数:29,代码来源:StatementInsert.java

示例3: insertTableValues

import org.hsqldb.navigator.RowSetNavigator; //导入方法依赖的package包/类
private void insertTableValues(Session session, PersistentStore store) {

        Result          result = nodes[LEFT].getResult(session);
        RowSetNavigator nav    = result.navigator;

        while (nav.hasNext()) {
            Object[] data    = nav.getNext();
            Object[] newdata = (Object[]) ArrayUtil.duplicateArray(data);
            Row row = (Row) store.getNewCachedObject(session, newdata, false);

            try {
                store.indexRow(session, row);
            } catch (HsqlException e) {}
        }
    }
 
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:16,代码来源:ExpressionTable.java

示例4: insertIntoTable

import org.hsqldb.navigator.RowSetNavigator; //导入方法依赖的package包/类
/**
 * Multi-row insert method. Used for CREATE TABLE AS ... queries.
 */
void insertIntoTable(Session session, Result result) {

    PersistentStore store = getRowStore(session);
    RowSetNavigator nav   = result.initialiseNavigator();

    while (nav.hasNext()) {
        Object[] data = nav.getNext();
        Object[] newData =
            (Object[]) ArrayUtil.resizeArrayIfDifferent(data, columnCount);

        insertData(session, store, newData);
    }
}
 
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:17,代码来源:Table.java

示例5: insertSys

import org.hsqldb.navigator.RowSetNavigator; //导入方法依赖的package包/类
/**
 * Used for system table inserts. No checks. No identity
 * columns.
 */
public int insertSys(Session session, PersistentStore store, Result ins) {

    RowSetNavigator nav   = ins.getNavigator();
    int             count = 0;

    while (nav.hasNext()) {
        insertSys(session, store, nav.getNext());

        count++;
    }

    return count;
}
 
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:18,代码来源:Table.java

示例6: insertIntoTable

import org.hsqldb.navigator.RowSetNavigator; //导入方法依赖的package包/类
/**
 * Multi-row insert method. Used for CREATE TABLE AS ... queries.
 */
void insertIntoTable(Session session, Result result) {

    PersistentStore store = getRowStore(session);
    RowSetNavigator nav   = result.initialiseNavigator();

    while (nav.hasNext()) {
        Object[] data = (Object[]) nav.getNext();
        Object[] newData =
            (Object[]) ArrayUtil.resizeArrayIfDifferent(data, columnCount);

        insertData(session, store, newData);
    }
}
 
开发者ID:Julien35,项目名称:dev-courses,代码行数:17,代码来源:Table.java

示例7: getInsertSelectNavigator

import org.hsqldb.navigator.RowSetNavigator; //导入方法依赖的package包/类
RowSetNavigator getInsertSelectNavigator(Session session) {

        Type[] colTypes  = baseTable.getColumnTypes();
        int[]  columnMap = insertColumnMap;

        //
        Result                result = queryExpression.getResult(session, 0);
        RowSetNavigator       nav         = result.initialiseNavigator();
        Type[]                sourceTypes = result.metaData.columnTypes;
        RowSetNavigatorClient newData     = new RowSetNavigatorClient(2);

        while (nav.hasNext()) {
            Object[] data       = baseTable.getNewRowData(session);
            Object[] sourceData = (Object[]) nav.getNext();

            for (int i = 0; i < columnMap.length; i++) {
                int j = columnMap[i];

                if (j == this.overrideUserValue) {
                    continue;
                }

                Type sourceType = sourceTypes[i];

                data[j] = colTypes[j].convertToType(session, sourceData[i],
                                                    sourceType);
            }

            newData.add(data);
        }

        return newData;
    }
 
开发者ID:Julien35,项目名称:dev-courses,代码行数:34,代码来源:StatementInsert.java

示例8: deleteRows

import org.hsqldb.navigator.RowSetNavigator; //导入方法依赖的package包/类
void deleteRows(Session session, Table table, RowSetNavigator oldRows) {

        while (oldRows.hasNext()) {
            oldRows.next();

            Row row = oldRows.getCurrentRow();

            if (!row.isDeleted(session)) {
                table.deleteNoRefCheck(session, row);
            }
        }
    }
 
开发者ID:s-store,项目名称:sstore-soft,代码行数:13,代码来源:StatementDML.java

示例9: insertResult

import org.hsqldb.navigator.RowSetNavigator; //导入方法依赖的package包/类
/**
 * Used for subquery inserts. No checks. No identity columns.
 */
void insertResult(PersistentStore store, Result ins) {

    RowSetNavigator nav = ins.initialiseNavigator();

    while (nav.hasNext()) {
        Object[] data = (Object[]) nav.getNext();
        Object[] newData = (Object[]) ArrayUtil.resizeArrayIfDifferent(data, getColumnCount());

        insertData(store, newData);
    }
}
 
开发者ID:s-store,项目名称:sstore-soft,代码行数:15,代码来源:Table.java

示例10: insertResult

import org.hsqldb.navigator.RowSetNavigator; //导入方法依赖的package包/类
/**
 * Used for subquery inserts. No checks. No identity
 * columns.
 */
void insertResult(Session session, PersistentStore store, Result ins) {

    RowSetNavigator nav = ins.initialiseNavigator();

    while (nav.hasNext()) {
        Object[] data = (Object[]) nav.getNext();
        Object[] newData =
            (Object[]) ArrayUtil.resizeArrayIfDifferent(data, columnCount);

        insertData(session, store, newData);
    }
}
 
开发者ID:Julien35,项目名称:dev-courses,代码行数:17,代码来源:Table.java

示例11: insertIntoTable

import org.hsqldb.navigator.RowSetNavigator; //导入方法依赖的package包/类
/**
 * Multi-row insert method. Used for CREATE TABLE AS ... queries.
 */
void insertIntoTable(Session session, Result result) {

    PersistentStore store = session.sessionData.getRowStore(this);
    RowSetNavigator nav = result.initialiseNavigator();

    while (nav.hasNext()) {
        Object[] data = (Object[]) nav.getNext();
        Object[] newData = (Object[]) ArrayUtil.resizeArrayIfDifferent(data, getColumnCount());

        insertData(store, newData);
    }
}
 
开发者ID:s-store,项目名称:s-store,代码行数:16,代码来源:Table.java

示例12: insertSys

import org.hsqldb.navigator.RowSetNavigator; //导入方法依赖的package包/类
/**
 * Used for system table inserts. No checks. No identity columns.
 */
public int insertSys(PersistentStore store, Result ins) {

    RowSetNavigator nav = ins.getNavigator();
    int count = 0;

    while (nav.hasNext()) {
        insertSys(store, (Object[]) nav.getNext());

        count++;
    }

    return count;
}
 
开发者ID:s-store,项目名称:s-store,代码行数:17,代码来源:Table.java

示例13: executeDirectBatchStatement

import org.hsqldb.navigator.RowSetNavigator; //导入方法依赖的package包/类
private Result executeDirectBatchStatement(Result cmd) {

        int[] updateCounts;
        int   count;

        count = 0;

        RowSetNavigator nav = cmd.initialiseNavigator();

        updateCounts = new int[nav.getSize()];

        Result error = null;

        while (nav.hasNext()) {
            Result   in;
            Object[] data = (Object[]) nav.getNext();
            String   sql  = (String) data[0];

            try {
                Statement cs = compileStatement(sql);

                in = executeCompiledStatement(cs, ValuePool.emptyObjectArray,
                                              cmd.queryTimeout);
            } catch (Throwable t) {
                in = Result.newErrorResult(t);

                // if (t instanceof OutOfMemoryError) {
                // System.gc();
                // }
                // "in" alread equals "err"
                // maybe test for OOME and do a gc() ?
                // t.printStackTrace();
            }

            if (in.isUpdateCount()) {
                updateCounts[count++] = in.getUpdateCount();
            } else if (in.isData()) {

                // FIXME:  we don't have what it takes yet
                // to differentiate between things like
                // stored procedure calls to methods with
                // void return type and select statements with
                // a single row/column containg null
                updateCounts[count++] = ResultConstants.SUCCESS_NO_INFO;
            } else if (in.mode == ResultConstants.CALL_RESPONSE) {
                updateCounts[count++] = ResultConstants.SUCCESS_NO_INFO;
            } else if (in.mode == ResultConstants.ERROR) {
                updateCounts = ArrayUtil.arraySlice(updateCounts, 0, count);
                error        = in;

                break;
            } else {
                throw Error.runtimeError(ErrorCode.U_S0500, "Session");
            }
        }

        return Result.newBatchedExecuteResponse(updateCounts, null, error);
    }
 
开发者ID:Julien35,项目名称:dev-courses,代码行数:59,代码来源:Session.java

示例14: executeDirectBatchStatement

import org.hsqldb.navigator.RowSetNavigator; //导入方法依赖的package包/类
private Result executeDirectBatchStatement(Result cmd) {

        int[] updateCounts;
        int   count;

        count = 0;

        RowSetNavigator nav = cmd.initialiseNavigator();

        updateCounts = new int[nav.getSize()];

        Result error = null;

        isBatch = true;

        while (nav.hasNext()) {
            Result   in;
            Object[] data = (Object[]) nav.getNext();
            String   sql  = (String) data[0];

            try {
                in = executeDirectStatement(sql);
            } catch (Throwable t) {
                in = Result.newErrorResult(t);

                // if (t instanceof OutOfMemoryError) {
                // System.gc();
                // }
                // "in" alread equals "err"
                // maybe test for OOME and do a gc() ?
                // t.printStackTrace();
            }

            if (in.isUpdateCount()) {
                updateCounts[count++] = in.getUpdateCount();
            } else if (in.isData()) {

                // FIXME:  we don't have what it takes yet
                // to differentiate between things like
                // stored procedure calls to methods with
                // void return type and select statements with
                // a single row/column containg null
                updateCounts[count++] = ResultConstants.SUCCESS_NO_INFO;
            } else if (in.isError()) {
                updateCounts = ArrayUtil.arraySlice(updateCounts, 0, count);
                error        = in;

                break;
            } else {
                throw Error.runtimeError(ErrorCode.U_S0500, "Session");
            }
        }

        isBatch = false;

        sessionData.updateLobUsageForBatch();

        return Result.newBatchedExecuteResponse(updateCounts, null, error);
    }
 
开发者ID:s-store,项目名称:sstore-soft,代码行数:60,代码来源:Session.java

示例15: fireAfterTriggers

import org.hsqldb.navigator.RowSetNavigator; //导入方法依赖的package包/类
void fireAfterTriggers(Session session, int trigVecIndex, RowSetNavigator rowSet) {

        if (!database.isReferentialIntegrity()) {
            return;
        }

        TriggerDef[] trigVec = triggerLists[trigVecIndex];

        for (int i = 0, size = trigVec.length; i < size; i++) {
            TriggerDef td = trigVec[i];
            boolean sqlTrigger = td instanceof TriggerDefSQL;

            if (td.hasOldTable()) {

                //
            }

            if (td.isForEachRow()) {
                while (rowSet.hasNext()) {
                    Object[] oldData = null;
                    Object[] newData = null;

                    switch (td.triggerType) {

                        case Trigger.DELETE_AFTER_ROW:
                            oldData = rowSet.getNext();

                            if (!sqlTrigger) {
                                oldData = (Object[]) ArrayUtil.duplicateArray(oldData);
                            }
                            break;

                        case Trigger.INSERT_AFTER_ROW:
                            newData = rowSet.getNext();

                            if (!sqlTrigger) {
                                newData = (Object[]) ArrayUtil.duplicateArray(newData);
                            }
                            break;
                    }

                    td.pushPair(session, oldData, newData);
                }

                rowSet.beforeFirst();
            } else {
                td.pushPair(session, null, null);
            }
        }
    }
 
开发者ID:s-store,项目名称:sstore-soft,代码行数:51,代码来源:Table.java


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