本文整理汇总了Java中org.hsqldb.navigator.RowSetNavigator.getSize方法的典型用法代码示例。如果您正苦于以下问题:Java RowSetNavigator.getSize方法的具体用法?Java RowSetNavigator.getSize怎么用?Java RowSetNavigator.getSize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.hsqldb.navigator.RowSetNavigator
的用法示例。
在下文中一共展示了RowSetNavigator.getSize方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initialiseLobSpace
import org.hsqldb.navigator.RowSetNavigator; //导入方法依赖的package包/类
private void initialiseLobSpace() {
Statement statement = sysLobSession.compileStatement(existsBlocksSQL);
Result result = statement.execute(sysLobSession);
if (result.isError()) {
throw result.getException();
}
RowSetNavigator navigator = result.getNavigator();
int size = navigator.getSize();
if (size > 0) {
return;
}
statement = sysLobSession.compileStatement(initialiseBlocksSQL);
Object[] params = new Object[3];
params[0] = ValuePool.INTEGER_0;
params[1] = ValuePool.getInt(totalBlockLimitCount);
params[2] = ValuePool.getLong(0);
sysLobSession.executeCompiledStatement(statement, params, 0);
}
示例2: insertTableValues
import org.hsqldb.navigator.RowSetNavigator; //导入方法依赖的package包/类
private void insertTableValues(Session session, PersistentStore store) {
Result result = nodes[LEFT].getResult(session);
RowSetNavigator nav = result.navigator;
int size = nav.getSize();
while (nav.hasNext()) {
Object[] data = nav.getNext();
Row row = (Row) store.getNewCachedObject(session, data, false);
try {
store.indexRow(session, row);
} catch (HsqlException e) {}
}
}
示例3: getDataResultSlice
import org.hsqldb.navigator.RowSetNavigator; //导入方法依赖的package包/类
Result getDataResultSlice(long id, int offset, int count) {
Result result = (Result) resultMap.get(id);
RowSetNavigator source = result.getNavigator();
if (offset + count > source.getSize()) {
count = source.getSize() - offset;
}
return Result.newDataRowsResult(result, offset, count);
}
示例4: getRowSetSlice
import org.hsqldb.navigator.RowSetNavigator; //导入方法依赖的package包/类
RowSetNavigatorClient getRowSetSlice(long id, int offset, int count) {
Result result = (Result) resultMap.get(id);
RowSetNavigator source = result.getNavigator();
if (offset + count > source.getSize()) {
count = source.getSize() - offset;
}
return new RowSetNavigatorClient(source, offset, count);
}
示例5: getInsertSelectNavigator
import org.hsqldb.navigator.RowSetNavigator; //导入方法依赖的package包/类
RowSetNavigator getInsertSelectNavigator(Session session) {
Type[] colTypes = baseTable.getColumnTypes();
int[] columnMap = insertColumnMap;
//
Result result = queryExpression.getResult(session, 0);
RowSetNavigator nav = result.initialiseNavigator();
Type[] sourceTypes = result.metaData.columnTypes;
RowSetNavigatorClient newData =
new RowSetNavigatorClient(nav.getSize());
while (nav.hasNext()) {
Object[] data = baseTable.getNewRowData(session);
Object[] sourceData = nav.getNext();
for (int i = 0; i < columnMap.length; i++) {
int j = columnMap[i];
if (j == this.overrideUserValue) {
continue;
}
Type sourceType = sourceTypes[i];
data[j] = colTypes[j].convertToType(session, sourceData[i],
sourceType);
}
newData.add(data);
}
return newData;
}
示例6: getBlockAddresses
import org.hsqldb.navigator.RowSetNavigator; //导入方法依赖的package包/类
private int[][] getBlockAddresses(long lobID, int offset, int limit) {
ResultMetaData meta = getSpanningBlocks.getParametersMetaData();
Object params[] = new Object[meta.getColumnCount()];
params[GET_LOB_PART.LOB_ID] = ValuePool.getLong(lobID);
params[GET_LOB_PART.BLOCK_OFFSET] = ValuePool.getInt(offset);
params[GET_LOB_PART.BLOCK_LIMIT] = ValuePool.getInt(limit);
sysLobSession.sessionContext.pushDynamicArguments(params);
Result result = getSpanningBlocks.execute(sysLobSession);
sysLobSession.sessionContext.pop();
RowSetNavigator navigator = result.getNavigator();
int size = navigator.getSize();
int[][] blocks = new int[size][3];
for (int i = 0; i < size; i++) {
navigator.absolute(i);
Object[] data = navigator.getCurrent();
blocks[i][LOBS.BLOCK_ADDR] =
((Integer) data[LOBS.BLOCK_ADDR]).intValue();
blocks[i][LOBS.BLOCK_COUNT] =
((Integer) data[LOBS.BLOCK_COUNT]).intValue();
blocks[i][LOBS.BLOCK_OFFSET] =
((Integer) data[LOBS.BLOCK_OFFSET]).intValue();
}
navigator.release();
return blocks;
}
示例7: executeDirectBatchStatement
import org.hsqldb.navigator.RowSetNavigator; //导入方法依赖的package包/类
private Result executeDirectBatchStatement(Result cmd) {
int[] updateCounts;
int count;
count = 0;
RowSetNavigator nav = cmd.initialiseNavigator();
updateCounts = new int[nav.getSize()];
Result error = null;
while (nav.hasNext()) {
Result in;
Object[] data = (Object[]) nav.getNext();
String sql = (String) data[0];
try {
Statement cs = compileStatement(sql);
in = executeCompiledStatement(cs, ValuePool.emptyObjectArray,
cmd.queryTimeout);
} catch (Throwable t) {
in = Result.newErrorResult(t);
// if (t instanceof OutOfMemoryError) {
// System.gc();
// }
// "in" alread equals "err"
// maybe test for OOME and do a gc() ?
// t.printStackTrace();
}
if (in.isUpdateCount()) {
updateCounts[count++] = in.getUpdateCount();
} else if (in.isData()) {
// FIXME: we don't have what it takes yet
// to differentiate between things like
// stored procedure calls to methods with
// void return type and select statements with
// a single row/column containg null
updateCounts[count++] = ResultConstants.SUCCESS_NO_INFO;
} else if (in.mode == ResultConstants.CALL_RESPONSE) {
updateCounts[count++] = ResultConstants.SUCCESS_NO_INFO;
} else if (in.mode == ResultConstants.ERROR) {
updateCounts = ArrayUtil.arraySlice(updateCounts, 0, count);
error = in;
break;
} else {
throw Error.runtimeError(ErrorCode.U_S0500, "Session");
}
}
return Result.newBatchedExecuteResponse(updateCounts, null, error);
}
示例8: executeDirectBatchStatement
import org.hsqldb.navigator.RowSetNavigator; //导入方法依赖的package包/类
private Result executeDirectBatchStatement(Result cmd) {
int[] updateCounts;
int count;
count = 0;
RowSetNavigator nav = cmd.initialiseNavigator();
updateCounts = new int[nav.getSize()];
Result error = null;
isBatch = true;
while (nav.hasNext()) {
Result in;
Object[] data = (Object[]) nav.getNext();
String sql = (String) data[0];
try {
in = executeDirectStatement(sql);
} catch (Throwable t) {
in = Result.newErrorResult(t);
// if (t instanceof OutOfMemoryError) {
// System.gc();
// }
// "in" alread equals "err"
// maybe test for OOME and do a gc() ?
// t.printStackTrace();
}
if (in.isUpdateCount()) {
updateCounts[count++] = in.getUpdateCount();
} else if (in.isData()) {
// FIXME: we don't have what it takes yet
// to differentiate between things like
// stored procedure calls to methods with
// void return type and select statements with
// a single row/column containg null
updateCounts[count++] = ResultConstants.SUCCESS_NO_INFO;
} else if (in.isError()) {
updateCounts = ArrayUtil.arraySlice(updateCounts, 0, count);
error = in;
break;
} else {
throw Error.runtimeError(ErrorCode.U_S0500, "Session");
}
}
isBatch = false;
sessionData.updateLobUsageForBatch();
return Result.newBatchedExecuteResponse(updateCounts, null, error);
}
示例9: getParts
import org.hsqldb.navigator.RowSetNavigator; //导入方法依赖的package包/类
private long[][] getParts(long lobID, long offset, long limit) {
ResultMetaData meta = getSpanningParts.getParametersMetaData();
Object[] params = new Object[meta.getColumnCount()];
params[GET_LOB_PART.LOB_ID] = ValuePool.getLong(lobID);
params[GET_LOB_PART.BLOCK_OFFSET] = ValuePool.getLong(offset);
params[GET_LOB_PART.BLOCK_LIMIT] = ValuePool.getLong(limit);
sysLobSession.sessionContext.pushDynamicArguments(params);
Result result = getSpanningParts.execute(sysLobSession);
sysLobSession.sessionContext.pop();
RowSetNavigator navigator = result.getNavigator();
int size = navigator.getSize();
long[][] blocks = new long[size][6];
for (int i = 0; i < size; i++) {
navigator.absolute(i);
Object[] data = navigator.getCurrent();
for (int j = 0; j < blocks[i].length; j++) {
blocks[i][j] = ((Number) data[j]).longValue();
}
}
navigator.release();
return blocks;
}
示例10: getLastPart
import org.hsqldb.navigator.RowSetNavigator; //导入方法依赖的package包/类
private long[] getLastPart(long lobID) {
ResultMetaData meta = getLastPart.getParametersMetaData();
Object[] params = new Object[meta.getColumnCount()];
params[GET_LOB_PART.LOB_ID] = ValuePool.getLong(lobID);
sysLobSession.sessionContext.pushDynamicArguments(params);
Result result = getLastPart.execute(sysLobSession);
sysLobSession.sessionContext.pop();
RowSetNavigator navigator = result.getNavigator();
int size = navigator.getSize();
long[] blocks = new long[6];
if (size == 0) {
blocks[ALLOC_PART.LOB_ID] = lobID;
} else {
navigator.absolute(0);
Object[] data = navigator.getCurrent();
for (int j = 0; j < blocks.length; j++) {
blocks[j] = ((Number) data[j]).longValue();
}
}
navigator.release();
return blocks;
}
示例11: getBlockAddresses
import org.hsqldb.navigator.RowSetNavigator; //导入方法依赖的package包/类
int[][] getBlockAddresses(Session session, long lobID, int offset,
int limit) {
ResultMetaData meta = getLobPart.getParametersMetaData();
Object params[] = new Object[meta.getColumnCount()];
params[0] = Long.valueOf(lobID);
params[1] = Integer.valueOf(offset);
params[2] = Integer.valueOf(limit);
session.sessionContext.pushDynamicArguments(params);
Result result = getLobPart.execute(session);
session.sessionContext.popDynamicArguments();
RowSetNavigator navigator = result.getNavigator();
int size = navigator.getSize();
int[][] blocks = new int[size][3];
for (int i = 0; i < size; i++) {
navigator.absolute(i);
Object[] data = navigator.getCurrent();
blocks[i][0] = ((Integer) data[LOBS.BLOCK_ADDR]).intValue();
blocks[i][1] = ((Integer) data[LOBS.BLOCK_COUNT]).intValue();
blocks[i][2] = ((Integer) data[LOBS.BLOCK_OFFSET]).intValue();
}
navigator.close();
return blocks;
}
示例12: getParts
import org.hsqldb.navigator.RowSetNavigator; //导入方法依赖的package包/类
private long[][] getParts(long lobID, long offset, long limit) {
ResultMetaData meta = getSpanningParts.getParametersMetaData();
Object params[] = new Object[meta.getColumnCount()];
params[GET_LOB_PART.LOB_ID] = ValuePool.getLong(lobID);
params[GET_LOB_PART.BLOCK_OFFSET] = ValuePool.getLong(offset);
params[GET_LOB_PART.BLOCK_LIMIT] = ValuePool.getLong(limit);
sysLobSession.sessionContext.pushDynamicArguments(params);
Result result = getSpanningParts.execute(sysLobSession);
sysLobSession.sessionContext.pop();
RowSetNavigator navigator = result.getNavigator();
int size = navigator.getSize();
long[][] blocks = new long[size][6];
for (int i = 0; i < size; i++) {
navigator.absolute(i);
Object[] data = navigator.getCurrent();
for (int j = 0; j < blocks[i].length; j++) {
blocks[i][j] = ((Number) data[j]).longValue();
}
}
navigator.release();
return blocks;
}
示例13: getLastPart
import org.hsqldb.navigator.RowSetNavigator; //导入方法依赖的package包/类
private long[] getLastPart(long lobID) {
ResultMetaData meta = getLastPart.getParametersMetaData();
Object params[] = new Object[meta.getColumnCount()];
params[GET_LOB_PART.LOB_ID] = ValuePool.getLong(lobID);
sysLobSession.sessionContext.pushDynamicArguments(params);
Result result = getLastPart.execute(sysLobSession);
sysLobSession.sessionContext.pop();
RowSetNavigator navigator = result.getNavigator();
int size = navigator.getSize();
long[] blocks = new long[6];
if (size == 0) {
blocks[ALLOC_PART.LOB_ID] = lobID;
} else {
navigator.absolute(0);
Object[] data = navigator.getCurrent();
for (int j = 0; j < blocks.length; j++) {
blocks[j] = ((Number) data[j]).longValue();
}
}
navigator.release();
return blocks;
}