• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java Session类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: writeDeleteStatement

import org.hsqldb.Session; //导入依赖的package包/类
public void writeDeleteStatement(Session session, Table table,
                                 Object[] data)
                                 throws HsqlException, IOException {

    schemaToLog = table.getName().schema;
    busyWriting = true;

    rowOut.reset();
    ((RowOutputTextLog) rowOut).setMode(RowOutputTextLog.MODE_DELETE);
    addSessionId(session);
    rowOut.write(BYTES_DELETE_FROM);
    rowOut.writeString(table.getName().statementName);
    rowOut.write(BYTES_WHERE);
    rowOut.writeData(table.getColumnCount(), table.getColumnTypes(),
                     data, table.columnList, table.getPrimaryKey());
    rowOut.write(BYTES_LINE_SEP);
    fileStreamOut.write(rowOut.getBuffer(), 0, rowOut.size());

    byteCount   += rowOut.size();
    needsSync   |= session.isAutoCommit();
    busyWriting = false;

    if (forceSync || writeDelay == 0) {
        sync();
    }
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:27,代码来源:ScriptWriterText.java


示例2: hasNulls

import org.hsqldb.Session; //导入依赖的package包/类
boolean hasNulls(Session session, Object[] rowData) {

        boolean uniqueNulls = session == null
                              || session.database.sqlUniqueNulls;
        boolean compareId = false;

        for (int j = 0; j < colIndex.length; j++) {
            if (rowData[colIndex[j]] == null) {
                compareId = true;

                if (uniqueNulls) {
                    break;
                }
            } else if (!uniqueNulls) {
                compareId = false;

                break;
            }
        }

        return compareId;
    }
 
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:23,代码来源:IndexAVL.java


示例3: compare

import org.hsqldb.Session; //导入依赖的package包/类
public int compare(Session session, Object a, Object b) {

        if (a == b) {
            return 0;
        }

        if (a == null) {
            return -1;
        }

        if (b == null) {
            return 1;
        }

        if (b instanceof BinaryData) {
            return session.database.lobManager.compare((BlobData) a,
                    ((BlobData) b).getBytes());
        }

        return session.database.lobManager.compare((BlobData) a, (BlobData) b);
    }
 
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:22,代码来源:BlobType.java


示例4: hasNulls

import org.hsqldb.Session; //导入依赖的package包/类
boolean hasNulls(Session session, Object[] rowData) {

        boolean uniqueNulls = session == null
                              || session.database.sqlUniqueNulls;
        boolean compareId = false;

        for (int j = 0; j < colIndex.length; j++) {
            if (rowData[colIndex[j]] == null) {
                compareId = true;

                if (uniqueNulls) {
                    break;
                }
            } else {
                compareId = false;

                break;
            }
        }

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


示例5: reindex

import org.hsqldb.Session; //导入依赖的package包/类
public void reindex(Session session, Index index) {

        writeLock();

        try {
            setAccessor(index, null);

            RowIterator it = table.rowIterator(this);

            while (it.hasNext()) {
                RowAVL row = (RowAVL) it.getNextRow();

                row.getNode(index.getPosition()).delete();
                index.insert(session, this, row);
            }
        } finally {
            writeUnlock();
        }
    }
 
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:20,代码来源:RowStoreAVL.java


示例6: overlaps

import org.hsqldb.Session; //导入依赖的package包/类
/**
 * The predicate "a OVERLAPS b" applies when both a and b are either period
 * names or period constructors.
 * This predicate returns True if the two periods have at least one time
 * point in common, i.e, if a[0] < b[1] and
 * a[1] > b[0]. This predicates is commutative: "a OVERLAPS B" must return
 * the same result of "b OVERLAPS a"
 * <p>
 *
 * @param session
 * @param a First period to compare
 * @param ta Types of the first period
 * @param b Second period to compare
 * @param tb Type of the second period
 *
 * @return {@link Boolean#TRUE} if the two periods overlaps,
 *          else {@link Boolean#FALSE}
 */
public static Boolean overlaps(Session session, Object[] a, Type[] ta,
                               Object[] b, Type[] tb) {

    Type commonType = normalizeInput(session, a, ta, b, tb, false);

    if (commonType == null) {
        return null;
    }

    if (commonType.compare(session, a[0], b[0]) > 0) {
        Object[] temp = a;

        a = b;
        b = temp;
    }

    if (commonType.compare(session, a[1], b[0]) > 0) {
        return Boolean.TRUE;
    }

    return Boolean.FALSE;
}
 
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:41,代码来源:DateTimeType.java


示例7: removeDuplicates

import org.hsqldb.Session; //导入依赖的package包/类
public void removeDuplicates(Session session) {

        sortFull(session);

        Object[] lastRowData = null;

        while (next()) {
            Object[] currentData = getCurrent();

            if (lastRowData != null
                    && fullIndex.compareRow(session, lastRowData, currentData)
                       == 0) {
                removeCurrent();
            } else {
                lastRowData = currentData;
            }
        }

        reset();
    }
 
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:21,代码来源:RowSetNavigatorDataTable.java


示例8: writeLogStatement

import org.hsqldb.Session; //导入依赖的package包/类
public void writeLogStatement(Session session,
                              String s) throws IOException {

    if (session != null) {
        schemaToLog = session.currentSchema;

        writeSessionIdAndSchema(session);
    }

    rowOut.reset();
    rowOut.writeString(s);
    rowOut.write(BYTES_LINE_SEP);
    writeRowOutToFile();

    needsSync = true;
}
 
开发者ID:Julien35,项目名称:dev-courses,代码行数:17,代码来源:ScriptWriterText.java


示例9: delete

import org.hsqldb.Session; //导入依赖的package包/类
/**
 * Row might have changed from memory to disk or indexes added
 */
public void delete(Session session, Row row) {

    NodeAVL node  = ((RowAVL) row).getNode(0);
    int     count = 0;

    while (node != null) {
        count++;

        node = node.nNext;
    }

    if ((isCached && row.isMemory()) || count != indexList.length) {
        row = ((Table) table).getDeleteRowFromLog(session, row.getData());
    }

    if (row != null) {
        super.delete(session, row);
    }
}
 
开发者ID:Julien35,项目名称:dev-courses,代码行数:23,代码来源:RowStoreAVLHybridExtended.java


示例10: newResult

import org.hsqldb.Session; //导入依赖的package包/类
public static Result newResult(Session session, int mode,
                               DataInput dataInput,
                               RowInputBinary in)
                               throws IOException, HsqlException {

    try {
        if (mode == ResultConstants.LARGE_OBJECT_OP) {
            return ResultLob.newLob(dataInput, false);
        }

        Result result = newResult(session, dataInput, in, mode);

        return result;
    } catch (IOException e) {
        throw Error.error(ErrorCode.X_08000);
    }
}
 
开发者ID:s-store,项目名称:s-store,代码行数:18,代码来源:Result.java


示例11: checkComplexity

import org.hsqldb.Session; //导入依赖的package包/类
public boolean checkComplexity(Session session, String password) {

        if (session == null || pwCheckFunction == null) {
            return true;
        }

        Result result = pwCheckFunction.invoke(session,
                                               new Object[]{ password }, null,
                                               true);
        Boolean check = (Boolean) result.getValueObject();

        if (check == null || !check.booleanValue()) {
            return false;
        }

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


示例12: setStore

import org.hsqldb.Session; //导入依赖的package包/类
public final void setStore(Session session, Table table,
                           PersistentStore store) {

    long dbscts = database.schemaManager.getSchemaChangeTimestamp();

    if (store.getTimestamp() == dbscts
            && !isNonCachedTable(table.getName().name)) {
        return;
    }

    // fredt - clear the contents of table and generate
    store.removeAll();
    store.setTimestamp(dbscts);

    int tableIndex = getSysTableID(table.getName().name);

    generateTable(session, store, tableIndex);
}
 
开发者ID:Julien35,项目名称:dev-courses,代码行数:19,代码来源:DatabaseInformationMain.java


示例13: compare

import org.hsqldb.Session; //导入依赖的package包/类
public int compare(Session session, Object a, Object b) {

        if (a == b) {
            return 0;
        }

        if (a == null) {
            return -1;
        }

        if (b == null) {
            return 1;
        }

        boolean boola = ((Boolean) a).booleanValue();
        boolean boolb = ((Boolean) b).booleanValue();

        return (boola == boolb) ? 0
                                : (boolb ? -1
                                         : 1);
    }
 
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:22,代码来源:BooleanType.java


示例14: writeRow

import org.hsqldb.Session; //导入依赖的package包/类
protected void writeRow(Session session, Table table,
                        Object[] data) throws HsqlException, IOException {

    busyWriting = true;

    rowOut.reset();
    ((RowOutputTextLog) rowOut).setMode(RowOutputTextLog.MODE_INSERT);
    addSessionId(session);
    rowOut.write(BYTES_INSERT_INTO);
    rowOut.writeString(table.getName().statementName);
    rowOut.write(BYTES_VALUES);
    rowOut.writeData(data, table);
    rowOut.write(BYTES_TERM);
    rowOut.write(BYTES_LINE_SEP);
    fileStreamOut.write(rowOut.getBuffer(), 0, rowOut.size());

    byteCount   += rowOut.size();
    needsSync   |= session.isAutoCommit();
    busyWriting = false;

    if (forceSync || writeDelay == 0) {
        sync();
    }
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:25,代码来源:ScriptWriterText.java


示例15: indexRow

import org.hsqldb.Session; //导入依赖的package包/类
public final void indexRow(Session session, Row row) {

        int i = 0;

        try {
            for (; i < indexList.length; i++) {
                indexList[i].insert(session, this, row);
            }
        } catch (HsqlException e) {

            // unique index violation - rollback insert
            for (--i; i >= 0; i--) {
                indexList[i].delete(this, row);
            }

            remove(row.getPos());

            throw e;
        }
    }
 
开发者ID:s-store,项目名称:sstore-soft,代码行数:21,代码来源:RowStoreAVL.java


示例16: delete

import org.hsqldb.Session; //导入依赖的package包/类
/**
 * Row might have changed from memory to disk or indexes added
 */
public void delete(Session session, Row row) {

    NodeAVL node  = ((RowAVL) row).getNode(0);
    int     count = 0;

    while (node != null) {
        count++;

        node = node.nNext;
    }

    if ((isCached ^ !row.isMemory()) || count != indexList.length) {
        row = ((Table) table).getDeleteRowFromLog(session, row.getData());
    }

    if (row != null) {
        super.delete(session, row);
    }
}
 
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:23,代码来源:RowStoreAVLHybridExtended.java


示例17: findFirstRow

import org.hsqldb.Session; //导入依赖的package包/类
/**
 * Return the first node equal to the indexdata object. The rowdata has the
 * same column mapping as this index.
 *
 * @param session session object
 * @param store store object
 * @param rowdata array containing index column data
 * @param matchCount count of columns to match
 * @param compareType int
 * @param reversed boolean
 * @param map boolean[]
 * @return iterator
 */
public RowIterator findFirstRow(Session session, PersistentStore store,
                                Object[] rowdata, int matchCount,
                                int distinctCount, int compareType,
                                boolean reversed, boolean[] map) {

    NodeAVL node = findNode(session, store, rowdata, defaultColMap,
                            matchCount, compareType,
                            TransactionManager.ACTION_READ, reversed);

    if (node == null) {
        return emptyIterator;
    }

    return new IndexRowIterator(session, store, this, node, distinctCount,
                                false, reversed);
}
 
开发者ID:Julien35,项目名称:dev-courses,代码行数:30,代码来源:IndexAVL.java


示例18: writeOtherStatement

import org.hsqldb.Session; //导入依赖的package包/类
/**
 * Records a Log entry for the specified SQL statement, on behalf of
 * the specified Session object.
 */
public synchronized void writeOtherStatement(Session session,
        String statement) {

    if (loggingEnabled) {
        log.writeOtherStatement(session, statement);
    }
}
 
开发者ID:Julien35,项目名称:dev-courses,代码行数:12,代码来源:Logger.java


示例19: cacheClear

import org.hsqldb.Session; //导入依赖的package包/类
/**
 * Clears the contents of cached system tables and resets user slots
 * to null. <p>
 *
 */
protected final void cacheClear(Session session) {

    int i = sysTables.length;

    while (i-- > 0) {
        Table t = sysTables[i];

        if (t != null) {
            t.clearAllData(session);
        }
    }
}
 
开发者ID:Julien35,项目名称:dev-courses,代码行数:18,代码来源:DatabaseInformationMain.java


示例20: writeInsertStatement

import org.hsqldb.Session; //导入依赖的package包/类
public void writeInsertStatement(Session session, Table table,
                                 Object[] data)
                                 throws HsqlException, IOException {

    schemaToLog = table.getName().schema;

    writeRow(session, table, data);
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:9,代码来源:ScriptWriterText.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java VertexIconShapeTransformer类代码示例发布时间:2022-05-23
下一篇:
Java IDRescorer类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap