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


Java ColumnBase.setType方法代码示例

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


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

示例1: newEmptyResultSet

import org.hsqldb.ColumnBase; //导入方法依赖的package包/类
public static JDBCResultSet newEmptyResultSet() {
    ResultMetaData md = ResultMetaData.newResultMetaData(1);

    ColumnBase column =
        new ColumnBase(null, null, null, "C1");
    column.setType(Type.SQL_INTEGER);
    md.columnTypes[0] = Type.SQL_INTEGER;

    md.columns[0] = column;

    Result r = Result.newSingleColumnResult(md);

    return newJDBCResultSet(r, md);
}
 
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:15,代码来源:JDBCResultSet.java

示例2: newEptyResultSet

import org.hsqldb.ColumnBase; //导入方法依赖的package包/类
public static JDBCResultSet newEptyResultSet() {
    ResultMetaData md = ResultMetaData.newResultMetaData(1);

    ColumnBase column =
        new ColumnBase(null, null, null, "C1");
    column.setType(Type.SQL_INTEGER);
    md.columnTypes[0] = Type.SQL_INTEGER;

    md.columns[0] = column;

    Result r = Result.newSingleColumnResult(md);

    return newJDBCResultSet(r, md);
}
 
开发者ID:Julien35,项目名称:dev-courses,代码行数:15,代码来源:JDBCResultSet.java

示例3: newColumnResult

import org.hsqldb.ColumnBase; //导入方法依赖的package包/类
private Result newColumnResult(long position,
                               int count) throws SQLException {

    if (!JDBCClobClient.isInLimits(data.length, position, count)) {
        throw JDBCUtil.outOfRangeArgument();
    }

    Type[] types = new Type[2];

    types[0] = Type.SQL_INTEGER;
    types[1] = elementType;

    ResultMetaData meta = ResultMetaData.newSimpleResultMetaData(types);

    meta.columnLabels = new String[] {
        "C1", "C2"
    };
    meta.colIndexes   = new int[] {
        -1, -1
    };
    meta.columns      = new ColumnBase[2];

    for (int i = 0; i < meta.columns.length; i++) {
        ColumnBase column = new ColumnBase("", "", "", "");

        column.setType(types[i]);

        meta.columns[i] = column;
    }

    RowSetNavigatorClient navigator = new RowSetNavigatorClient();

    for (int i = (int) position; i < position + count; i++) {
        Object[] rowData = new Object[2];

        rowData[0] = Integer.valueOf(i + 1);
        rowData[1] = data[i];

        navigator.add(rowData);
    }

    Result result = Result.newDataResult(meta);

    result.setNavigator(navigator);

    return result;
}
 
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:48,代码来源:JDBCArrayBasic.java

示例4: newColumnResult

import org.hsqldb.ColumnBase; //导入方法依赖的package包/类
private Result newColumnResult(long position,
                               int count) throws SQLException {

    if (!JDBCClobClient.isInLimits(data.length, position, count)) {
        throw Util.outOfRangeArgument();
    }

    Type[] types = new Type[2];

    types[0] = Type.SQL_INTEGER;
    types[1] = elementType;

    ResultMetaData meta = ResultMetaData.newSimpleResultMetaData(types);

    meta.columnLabels = new String[] {
        "C1", "C2"
    };
    meta.colIndexes   = new int[] {
        -1, -1
    };
    meta.columns      = new ColumnBase[2];

    for (int i = 0; i < meta.columns.length; i++) {
        ColumnBase column = new ColumnBase("", "", "", "");

        column.setType(types[i]);

        meta.columns[i] = column;
    }

    RowSetNavigatorClient navigator = new RowSetNavigatorClient();

    for (int i = (int) position; i < position + count; i++) {
        Object[] rowData = new Object[2];

        rowData[0] = Integer.valueOf(i + 1);
        rowData[1] = data[i];

        navigator.add(rowData);
    }

    Result result = Result.newDataResult(meta);

    result.setNavigator(navigator);

    return result;
}
 
开发者ID:RabadanLab,项目名称:Pegasus,代码行数:48,代码来源:JDBCArrayBasic.java


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