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

Java Error类代码示例

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

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



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

示例1: read

import org.hsqldb.error.Error; //导入依赖的package包/类
public void read(RowInputInterface in) {

        this.position = in.getPos();

        int[] array    = bitMap.getIntArray();
        int   capacity = array.length;

        try {
            for (int i = 0; i < capacity; i++) {
                array[i] = in.readInt();
            }
        } catch (IOException e) {
            throw Error.error(ErrorCode.GENERAL_IO_ERROR, e);
        }

        hasChanged = false;
    }
 
开发者ID:Julien35,项目名称:dev-courses,代码行数:18,代码来源:BitMapCachedObject.java


示例2: getCharacterType

import org.hsqldb.error.Error; //导入依赖的package包/类
public static CharacterType getCharacterType(int type, long length) {

        switch (type) {

            case Types.SQL_CHAR :
                if (length < fixedTypesLength) {
                    return charArray[(int) length];
                }

            // fall through
            case Types.SQL_VARCHAR :
                return new CharacterType(type, (int) length);

            case Types.SQL_CLOB :
                return new ClobType(length);

            default :
                throw Error.runtimeError(ErrorCode.U_S0500, "CharacterType");
        }
    }
 
开发者ID:Julien35,项目名称:dev-courses,代码行数:21,代码来源:CharacterType.java


示例3: getValues

import org.hsqldb.error.Error; //导入依赖的package包/类
public Object[] getValues(Session session) {

        RowIterator it = rowIterator(session);

        if (it.hasNext()) {
            Row row = it.getNextRow();

            if (it.hasNext()) {
                throw Error.error(ErrorCode.X_21000);
            }

            return row.getData();
        } else {
            return new Object[getColumnCount()];
        }
    }
 
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:17,代码来源:TableDerived.java


示例4: releaseSavepoint

import org.hsqldb.error.Error; //导入依赖的package包/类
/**
 * Releases a savepoint
 *
 * @param  name name of savepoint
 * @throws  HsqlException if name does not correspond to a savepoint
 */
public synchronized void releaseSavepoint(String name) {

    // remove this and all later savepoints
    int index = sessionContext.savepoints.getIndex(name);

    if (index < 0) {
        throw Error.error(ErrorCode.X_3B001, name);
    }

    while (sessionContext.savepoints.size() > index) {
        sessionContext.savepoints.remove(sessionContext.savepoints.size()
                                         - 1);
        sessionContext.savepointTimestamps.removeLast();
    }
}
 
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:22,代码来源:Session.java


示例5: addColumn

import org.hsqldb.error.Error; //导入依赖的package包/类
/**
 *  Performs the table level checks and adds a column to the table at the
 *  DDL level. Only used at table creation, not at alter column.
 */
public void addColumn(ColumnSchema column) {

    String name = column.getName().name;

    if (findColumn(name) >= 0) {
        throw Error.error(ErrorCode.X_42504, name);
    }

    if (column.isIdentity()) {
        if (identityColumn != -1) {
            throw Error.error(ErrorCode.X_42525, name);
        }

        identityColumn   = columnCount;
        identitySequence = column.getIdentitySequence();
    }

    addColumnNoCheck(column);
}
 
开发者ID:Julien35,项目名称:dev-courses,代码行数:24,代码来源:Table.java


示例6: setDataReadOnly

import org.hsqldb.error.Error; //导入依赖的package包/类
public void setDataReadOnly(boolean value) {

        if (!value) {
            if (isReversed) {
                throw Error.error(ErrorCode.DATA_IS_READONLY);
            }

            if (database.isFilesReadOnly()) {
                throw Error.error(ErrorCode.DATABASE_IS_READONLY);
            }

            if (isConnected()) {
                store.getCache().close();
                store.getCache().open(value);
            }
        }

        isReadOnly = value;
    }
 
开发者ID:Julien35,项目名称:dev-courses,代码行数:20,代码来源:TextTable.java


示例7: setDBModified

import org.hsqldb.error.Error; //导入依赖的package包/类
public void setDBModified(int mode) {

        String value;

        switch (mode) {

            case FILES_NOT_MODIFIED :
                value = MODIFIED_NO;
                break;

            case FILES_MODIFIED :
                value = MODIFIED_YES;
                break;

            case FILES_MODIFIED_NEW :
                value = MODIFIED_YES_NEW;
                break;

            default :
                throw Error.runtimeError(ErrorCode.U_S0500,
                                         "HsqlDatabaseProperties");
        }

        stringProps.put(hsqldb_modified, value);
        save();
    }
 
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:27,代码来源:HsqlDatabaseProperties.java


示例8: hasColumn

import org.hsqldb.error.Error; //导入依赖的package包/类
boolean hasColumn(int colIndex) {

        switch (constType) {

            case SchemaObject.ConstraintTypes.CHECK :
                return rangeVariable.usedColumns[colIndex];

            case SchemaObject.ConstraintTypes.PRIMARY_KEY :
            case SchemaObject.ConstraintTypes.UNIQUE :
            case SchemaObject.ConstraintTypes.MAIN :
                return ArrayUtil.find(core.mainCols, colIndex) != -1;

            case SchemaObject.ConstraintTypes.FOREIGN_KEY :
                return ArrayUtil.find(core.refCols, colIndex) != -1;

            default :
                throw Error.runtimeError(ErrorCode.U_S0500, "Constraint");
        }
    }
 
开发者ID:Julien35,项目名称:dev-courses,代码行数:20,代码来源:Constraint.java


示例9: getIntegerProperty

import org.hsqldb.error.Error; //导入依赖的package包/类
public int getIntegerProperty(String key) {

        int      value;
        Object[] metaData = (Object[]) dbMeta.get(key);

        if (metaData == null) {
            throw Error.error(ErrorCode.X_42555, key);
        }

        value =
            ((Integer) metaData[HsqlProperties.indexDefaultValue]).intValue();

        String prop = stringProps.getProperty(key);

        if (prop != null) {
            try {
                value = Integer.parseInt(prop);
            } catch (NumberFormatException e) {}
        }

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


示例10: checkDelete

import org.hsqldb.error.Error; //导入依赖的package包/类
public void checkDelete(SchemaObject object) {

        if (object instanceof Table) {
            Table table = (Table) object;

            if (isFullyAccessibleByRole(table.getName())) {
                return;
            }

            Right right = (Right) fullRightsMap.get(table.getName());

            if (right != null && right.canDelete()) {
                return;
            }
        }

        throw Error.error(ErrorCode.X_42501, object.getName().name);
    }
 
开发者ID:Julien35,项目名称:dev-courses,代码行数:19,代码来源:Grantee.java


示例11: saveRow

import org.hsqldb.error.Error; //导入依赖的package包/类
/**
 * The row is always in uncommittedCache.
 * Saves the row as normal and removes it
 */
public void saveRow(CachedObject row) {

    writeLock.lock();

    try {
        setFileModified();
        saveRowNoLock(row);
        uncommittedCache.remove(row.getPos());
        cache.put(row);
    } catch (Throwable e) {
        database.logger.logSevereEvent("saveRow failed", e);

        throw Error.error(ErrorCode.DATA_FILE_ERROR, e);
    } finally {
        writeLock.unlock();
    }
}
 
开发者ID:Julien35,项目名称:dev-courses,代码行数:22,代码来源:TextCache.java


示例12: getAggregateType

import org.hsqldb.error.Error; //导入依赖的package包/类
public Type getAggregateType(Type other) {

        if (other == null) {
            return this;
        }

        if (other == SQL_ALL_TYPES) {
            return this;
        }

        if (typeCode == other.typeCode) {
            return this;
        }

        throw Error.error(ErrorCode.X_42562);
    }
 
开发者ID:Julien35,项目名称:dev-courses,代码行数:17,代码来源:OtherType.java


示例13: setFileModified

import org.hsqldb.error.Error; //导入依赖的package包/类
protected void setFileModified() {

        try {
            if (!fileModified) {

                // unset saved flag;
                int flags = getFlags();

                flags = BitMap.unset(flags, FLAG_ISSAVED);

                setFlags(flags);
                logDetailEvent("setFileModified flag set ");

                fileModified = true;
            }
        } catch (Throwable t) {
            logSevereEvent("DataFileCache.setFileModified", t);

            throw Error.error(ErrorCode.DATA_FILE_ERROR, t);
        }
    }
 
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:22,代码来源:DataFileCache.java


示例14: Constraint

import org.hsqldb.error.Error; //导入依赖的package包/类
/**
 *  Constructor declaration for PK and UNIQUE
 */
public Constraint(HsqlName name, Table t, Index index, int type) {

    this.name      = name;
    constType      = type;
    core           = new ConstraintCore();
    core.mainTable = t;
    core.mainIndex = index;
    core.mainCols  = index.getColumns();

    for (int i = 0; i < core.mainCols.length; i++) {
        Type dataType = t.getColumn(core.mainCols[i]).getDataType();

        if (dataType.isLobType()) {
            throw Error.error(ErrorCode.X_42534);
        }
    }
}
 
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:21,代码来源:Constraint.java


示例15: newResult

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

    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:tiweGH,项目名称:OpenDiabetes,代码行数:17,代码来源:Result.java


示例16: getCharacterType

import org.hsqldb.error.Error; //导入依赖的package包/类
public static CharacterType getCharacterType(int type, long length,
        Collation collation) {

    if (collation == null) {
        collation = Collation.getDefaultInstance();
    }

    switch (type) {

        case Types.SQL_VARCHAR :
        case Types.SQL_CHAR :
            return new CharacterType(collation, type, (int) length);

        case Types.SQL_CLOB :
            CharacterType typeObject = new ClobType(length);

            typeObject.collation = collation;

            return typeObject;

        default :
            throw Error.runtimeError(ErrorCode.U_S0500, "CharacterType");
    }
}
 
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:25,代码来源:CharacterType.java


示例17: TableDerived

import org.hsqldb.error.Error; //导入依赖的package包/类
public TableDerived(Database database, HsqlName name, int type) {

        super(database, name, type);

        switch (type) {

            // for special use, not INFORMATION_SCHEMA views
            case TableBase.CHANGE_SET_TABLE :
            case TableBase.SYSTEM_TABLE :
            case TableBase.FUNCTION_TABLE :
            case TableBase.VIEW_TABLE :
            case TableBase.RESULT_TABLE :
            case TableBase.SYSTEM_SUBQUERY :
                break;

            default :
                throw Error.runtimeError(ErrorCode.U_S0500, "Table");
        }
    }
 
开发者ID:Julien35,项目名称:dev-courses,代码行数:20,代码来源:TableDerived.java


示例18: getUniqueColumnNameSet

import org.hsqldb.error.Error; //导入依赖的package包/类
public OrderedHashSet getUniqueColumnNameSet() {

        OrderedHashSet set = new OrderedHashSet();

        if (columnAliases != null) {
            set.addAll(columnAliases);

            return set;
        }

        for (int i = 0; i < rangeTable.columnList.size(); i++) {
            String  name  = rangeTable.getColumn(i).getName().name;
            boolean added = set.add(name);

            if (!added) {
                throw Error.error(ErrorCode.X_42578, name);
            }
        }

        return set;
    }
 
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:22,代码来源:RangeVariable.java


示例19: checkCheckConstraint

import org.hsqldb.error.Error; //导入依赖的package包/类
void checkCheckConstraint(Session session, Table table,
                          ColumnSchema column, Object data) {

    session.sessionData.currentValue = data;

    boolean nomatch = Boolean.FALSE.equals(check.getValue(session));

    session.sessionData.currentValue = null;

    if (nomatch) {
        String[] info = new String[] {
            name.statementName,
            table == null ? ""
                          : table.getName().statementName,
            column == null ? ""
                           : column.getName().statementName,
        };

        throw Error.error(null, ErrorCode.X_23513,
                          ErrorCode.COLUMN_CONSTRAINT, info);
    }
}
 
开发者ID:Julien35,项目名称:dev-courses,代码行数:23,代码来源:Constraint.java


示例20: getResult

import org.hsqldb.error.Error; //导入依赖的package包/类
Result getResult(Session session) {

        switch (type) {

            case StatementTypes.RETURN :
            case StatementTypes.CONDITION :
                Result result = expression.getResult(session);

                // data navigator has statement scope and will be cleared at the end of statement
                if (result.isData()) {
                    RowSetNavigatorData navigator =
                        new RowSetNavigatorData(session,
                                                result.getNavigator());

                    result.setNavigator(navigator);
                }

                return result;

            default :
                throw Error.runtimeError(ErrorCode.U_S0500, "");
        }
    }
 
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:24,代码来源:StatementExpression.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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