本文整理汇总了Java中org.hsqldb.navigator.RowSetNavigator类的典型用法代码示例。如果您正苦于以下问题:Java RowSetNavigator类的具体用法?Java RowSetNavigator怎么用?Java RowSetNavigator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RowSetNavigator类属于org.hsqldb.navigator包,在下文中一共展示了RowSetNavigator类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: registerLobForResult
import org.hsqldb.navigator.RowSetNavigator; //导入依赖的package包/类
public void registerLobForResult(Result result) {
RowSetNavigator navigator = result.getNavigator();
if (navigator == null) {
registerLobsForRow((Object[]) result.valueData);
} else {
while (navigator.next()) {
Object[] data = navigator.getCurrent();
registerLobsForRow(data);
}
navigator.reset();
}
resultLobs.clear();
}
示例3: getCurrent
import org.hsqldb.navigator.RowSetNavigator; //导入依赖的package包/类
/**
* Fetches the current row of the result set.
*
* @throws SQLException when result set is closed; result set is empty;
* result set is before first; result set is alfter last; no row data is
* available.
* @return Object[]
*/
protected Object[] getCurrent() throws SQLException {
final RowSetNavigator lnavigator = this.navigator;
if (lnavigator == null) {
throw JDBCUtil.sqlException(ErrorCode.X_24501);
} else if (lnavigator.isEmpty()) {
throw JDBCUtil.sqlException(ErrorCode.X_24504, ErrorCode.M_RS_EMPTY);
} else if (lnavigator.isBeforeFirst()) {
throw JDBCUtil.sqlException(ErrorCode.X_24504,
ErrorCode.M_RS_BEFORE_FIRST);
} else if (lnavigator.isAfterLast()) {
throw JDBCUtil.sqlException(ErrorCode.X_24504,
ErrorCode.M_RS_AFTER_LAST);
}
Object[] data = lnavigator.getCurrent();
if (data == null) {
throw JDBCUtil.sqlException(ErrorCode.X_24501);
}
return data;
}
示例4: fireTriggers
import org.hsqldb.navigator.RowSetNavigator; //导入依赖的package包/类
void fireTriggers(Session session, int trigVecIndex,
RowSetNavigator rowSet) {
if (!database.isReferentialIntegrity()) {
return;
}
TriggerDef[] trigVec = triggerLists[trigVecIndex];
for (int i = 0, size = trigVec.length; i < size; i++) {
TriggerDef td = trigVec[i];
boolean sqlTrigger = td instanceof TriggerDefSQL;
if (td.hasOldTable()) {
//
}
td.pushPair(session, null, null);
}
}
示例5: getInsertValuesNavigator
import org.hsqldb.navigator.RowSetNavigator; //导入依赖的package包/类
RowSetNavigator getInsertValuesNavigator(Session session) {
Type[] colTypes = baseTable.getColumnTypes();
//
Expression[] list = insertExpression.nodes;
RowSetNavigatorClient newData = new RowSetNavigatorClient(list.length);
for (int j = 0; j < list.length; j++) {
Expression[] rowArgs = list[j].nodes;
Object[] data = getInsertData(session, colTypes, rowArgs);
newData.add(data);
}
return newData;
}
示例6: initialiseNavigator
import org.hsqldb.navigator.RowSetNavigator; //导入依赖的package包/类
public RowSetNavigator initialiseNavigator() {
switch (mode) {
case ResultConstants.BATCHEXECUTE :
case ResultConstants.BATCHEXECDIRECT :
case ResultConstants.BATCHEXECRESPONSE :
case ResultConstants.SETSESSIONATTR :
case ResultConstants.PARAM_METADATA :
navigator.beforeFirst();
return navigator;
case ResultConstants.DATA :
case ResultConstants.DATAHEAD :
case ResultConstants.GENERATED :
navigator.reset();
return navigator;
default :
throw Error.runtimeError(ErrorCode.U_S0500, "Result");
}
}
示例7: getCurrent
import org.hsqldb.navigator.RowSetNavigator; //导入依赖的package包/类
/**
* Fetches the current row of the result set.
*
* @throws SQLException when result set is closed; result set is empty;
* result set is before first; result set is alfter last; no row data is
* available.
* @return Object[]
*/
private Object[] getCurrent() throws SQLException {
final RowSetNavigator lnavigator = this.navigator;
if (lnavigator == null) {
throw Util.sqlException(ErrorCode.X_24501);
} else if (lnavigator.isEmpty()) {
throw Util.sqlException(ErrorCode.X_24504, ErrorCode.M_RS_EMPTY);
} else if (lnavigator.isBeforeFirst()) {
throw Util.sqlException(ErrorCode.X_24504,
ErrorCode.M_RS_BEFORE_FIRST);
} else if (lnavigator.isAfterLast()) {
throw Util.sqlException(ErrorCode.X_24504,
ErrorCode.M_RS_AFTER_LAST);
}
Object[] data = lnavigator.getCurrent();
if (data == null) {
throw Util.sqlException(ErrorCode.X_24501);
}
return data;
}
示例8: readDDL
import org.hsqldb.navigator.RowSetNavigator; //导入依赖的package包/类
protected void readDDL(Session session) throws IOException {
Result r = Result.newResult(dataStreamIn, rowIn);
r.readAdditionalResults(session, dataStreamIn, rowIn);
RowSetNavigator nav = r.initialiseNavigator();
while (nav.hasNext()) {
Object[] data = (Object[]) nav.getNext();
String s = (String) data[0];
Result result = session.executeDirectStatement(s);
if (result.isError()) {
db.logger.appLog.logContext(SimpleLog.LOG_ERROR,
result.getMainString());
throw Error.error(result);
}
}
}
示例9: initialiseNavigator
import org.hsqldb.navigator.RowSetNavigator; //导入依赖的package包/类
public RowSetNavigator initialiseNavigator() {
switch (mode) {
case ResultConstants.BATCHEXECUTE :
case ResultConstants.BATCHEXECDIRECT :
case ResultConstants.BATCHEXECRESPONSE :
case ResultConstants.EXECUTE :
case ResultConstants.UPDATE_RESULT :
case ResultConstants.SETSESSIONATTR :
case ResultConstants.PARAM_METADATA :
navigator.beforeFirst();
return navigator;
case ResultConstants.DATA :
case ResultConstants.DATAHEAD :
navigator.reset();
return navigator;
default :
throw Error.runtimeError(ErrorCode.U_S0500, "Result");
}
}
示例10: 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;
}
示例11: 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);
}
示例12: 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);
}
示例13: insertSingleRow
import org.hsqldb.navigator.RowSetNavigator; //导入依赖的package包/类
Result insertSingleRow(Session session, PersistentStore store,
Object[] data) {
session.sessionData.startRowProcessing();
baseTable.setIdentityColumn(session, data);
if (baseTable.triggerLists[Trigger.INSERT_BEFORE_ROW].length > 0) {
baseTable.fireTriggers(session, Trigger.INSERT_BEFORE_ROW, null,
data, null);
}
baseTable.insertSingleRow(session, store, data, null);
performIntegrityChecks(session, baseTable, null, data, null);
if (session.database.isReferentialIntegrity()) {
for (int i = 0, size = baseTable.fkConstraints.length; i < size;
i++) {
baseTable.fkConstraints[i].checkInsert(session, baseTable,
data, true);
}
}
if (baseTable.triggerLists[Trigger.INSERT_AFTER_ROW].length > 0) {
baseTable.fireTriggers(session, Trigger.INSERT_AFTER_ROW, null,
data, null);
}
if (baseTable.triggerLists[Trigger.INSERT_AFTER].length > 0) {
baseTable.fireTriggers(session, Trigger.INSERT_AFTER,
(RowSetNavigator) null);
}
session.sessionContext
.diagnosticsVariables[ExpressionColumn.idx_row_count] =
Integer.valueOf(1);
return Result.updateOneResult;
}
示例14: insertTableValues
import org.hsqldb.navigator.RowSetNavigator; //导入依赖的package包/类
private void insertTableValues(Session session, PersistentStore store) {
Result result = nodes[LEFT].getResult(session);
RowSetNavigator nav = result.navigator;
while (nav.hasNext()) {
Object[] data = nav.getNext();
Object[] newdata = (Object[]) ArrayUtil.duplicateArray(data);
Row row = (Row) store.getNewCachedObject(session, newdata, false);
try {
store.indexRow(session, row);
} catch (HsqlException e) {}
}
}
示例15: insertIntoTable
import org.hsqldb.navigator.RowSetNavigator; //导入依赖的package包/类
/**
* Multi-row insert method. Used for CREATE TABLE AS ... queries.
*/
void insertIntoTable(Session session, Result result) {
PersistentStore store = getRowStore(session);
RowSetNavigator nav = result.initialiseNavigator();
while (nav.hasNext()) {
Object[] data = nav.getNext();
Object[] newData =
(Object[]) ArrayUtil.resizeArrayIfDifferent(data, columnCount);
insertData(session, store, newData);
}
}