本文整理汇总了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);
}
示例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);
}
示例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;
}
示例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;
}