本文整理汇总了Java中org.hsqldb.ColumnBase类的典型用法代码示例。如果您正苦于以下问题:Java ColumnBase类的具体用法?Java ColumnBase怎么用?Java ColumnBase使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ColumnBase类属于org.hsqldb包,在下文中一共展示了ColumnBase类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: encodeTableColumnAttrs
import org.hsqldb.ColumnBase; //导入依赖的package包/类
private static int encodeTableColumnAttrs(ColumnBase column) {
int out = column.getNullability(); // always between 0x00 and 0x02
if (column.isIdentity()) {
out |= 0x00000004;
}
if (column.isWriteable()) {
out |= 0x00000008;
}
if (column.isSearchable()) {
out |= 0x00000010;
}
return out;
}
示例2: 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);
}
示例3: getTableOidForColumn
import org.hsqldb.ColumnBase; //导入依赖的package包/类
public static int getTableOidForColumn(int colIndex, ResultMetaData md) {
if (!md.isTableColumn(colIndex)) {
return 0;
}
ColumnBase col = md.columns[colIndex];
int hashCode = (col.getSchemaNameString() + '.'
+ col.getTableNameString()).hashCode();
if (hashCode < 0) {
hashCode *= -1;
}
return hashCode;
}
示例4: newResultMetaData
import org.hsqldb.ColumnBase; //导入依赖的package包/类
public static ResultMetaData newResultMetaData(Type[] types,
int[] baseColumnIndexes, int colCount, int extColCount) {
ResultMetaData md = new ResultMetaData(RESULT_METADATA);
md.columnLabels = new String[colCount];
md.columns = new ColumnBase[colCount];
md.columnTypes = types;
md.colIndexes = baseColumnIndexes;
md.columnCount = colCount;
md.extendedColumnCount = extColCount;
return md;
}
示例5: decodeTableColumnAttrs
import org.hsqldb.ColumnBase; //导入依赖的package包/类
private static void decodeTableColumnAttrs(int in, ColumnBase column) {
column.setNullability((byte) (in & 0x00000003));
column.setIdentity((in & 0x00000004) != 0);
column.setWriteable((in & 0x00000008) != 0);
column.setSearchable((in & 0x00000010) != 0);
}
示例6: 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);
}
示例7: encodeTableColumnAttrs
import org.hsqldb.ColumnBase; //导入依赖的package包/类
private static int encodeTableColumnAttrs(ColumnBase column) {
int out = column.getNullability(); // always between 0x00 and 0x02
if (column.isIdentity()) {
out |= 0x00000004;
}
if (column.isWriteable()) {
out |= 0x00000008;
}
return out;
}
示例8: 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;
}
示例9: decodeTableColumnAttrs
import org.hsqldb.ColumnBase; //导入依赖的package包/类
private static void decodeTableColumnAttrs(int in, ColumnBase column) {
column.setNullability((byte) (in & 0x0000000f));
column.setIdentity((in & 0x00000010) != 0);
}
示例10: 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;
}
示例11: decodeTableColumnAttrs
import org.hsqldb.ColumnBase; //导入依赖的package包/类
private static void decodeTableColumnAttrs(int in, ColumnBase column) {
column.setNullability((byte) (in & 0x00000003));
column.setIdentity((in & 0x00000004) != 0);
column.setWriteable((in & 0x00000008) != 0);
}
示例12: newSingleColumnMetaData
import org.hsqldb.ColumnBase; //导入依赖的package包/类
public static ResultMetaData newSingleColumnMetaData(String colName) {
ResultMetaData md = ResultMetaData.newResultMetaData(1);
md.columns[0] = new ColumnBase(null, null, null, colName);
md.columns[0].setType(Type.SQL_VARCHAR_DEFAULT);
md.prepareData();
return md;
}
示例13: encodeTableColumnAttrs
import org.hsqldb.ColumnBase; //导入依赖的package包/类
private static int encodeTableColumnAttrs(ColumnBase column) {
int out = column.getNullability(); // always between 0x00 and 0x02
if (column.isIdentity()) {
out |= 0x00000010;
}
return out;
}
示例14: newSingleColumnResult
import org.hsqldb.ColumnBase; //导入依赖的package包/类
public static Result newSingleColumnResult(String colName, Type type) {
Result result = newResult(ResultConstants.DATA);
result.metaData = ResultMetaData.newResultMetaData(1);
result.metaData.columns[0] = new ColumnBase(null, null, null, colName);
result.metaData.columns[0].setType(type);
result.metaData.prepareData();
//
result.navigator = new RowSetNavigatorClient(8);
return result;
}