本文整理汇总了Java中org.hsqldb.navigator.RowSetNavigator.getNext方法的典型用法代码示例。如果您正苦于以下问题:Java RowSetNavigator.getNext方法的具体用法?Java RowSetNavigator.getNext怎么用?Java RowSetNavigator.getNext使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.hsqldb.navigator.RowSetNavigator
的用法示例。
在下文中一共展示了RowSetNavigator.getNext方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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);
}
}
}
示例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;
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) {}
}
}
示例3: 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);
}
}
示例4: 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 = (Object[]) nav.getNext();
Object[] newData =
(Object[]) ArrayUtil.resizeArrayIfDifferent(data, columnCount);
insertData(session, store, newData);
}
}
示例5: 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 = session.sessionData.getRowStore(this);
RowSetNavigator nav = result.initialiseNavigator();
while (nav.hasNext()) {
Object[] data = (Object[]) nav.getNext();
Object[] newData = (Object[]) ArrayUtil.resizeArrayIfDifferent(data, getColumnCount());
insertData(store, newData);
}
}
示例6: insertResult
import org.hsqldb.navigator.RowSetNavigator; //导入方法依赖的package包/类
/**
* Used for subquery inserts. No checks. No identity
* columns.
*/
void insertResult(Session session, PersistentStore store, Result ins) {
RowSetNavigator nav = ins.initialiseNavigator();
while (nav.hasNext()) {
Object[] data = (Object[]) nav.getNext();
Object[] newData =
(Object[]) ArrayUtil.resizeArrayIfDifferent(data, columnCount);
insertData(session, store, newData);
}
}
示例7: 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(2);
while (nav.hasNext()) {
Object[] data = baseTable.getNewRowData(session);
Object[] sourceData = (Object[]) nav.getNext();
for (int i = 0; i < columnMap.length; i++) {
int j = columnMap[i];
Type sourceType = sourceTypes[i];
data[j] = colTypes[j].convertToType(session, sourceData[i],
sourceType);
}
newData.add(data);
}
return newData;
}
示例8: 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(2);
while (nav.hasNext()) {
Object[] data = baseTable.getNewRowData(session);
Object[] sourceData = (Object[]) 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;
}
示例9: insertResult
import org.hsqldb.navigator.RowSetNavigator; //导入方法依赖的package包/类
/**
* Used for subquery inserts. No checks. No identity columns.
*/
void insertResult(PersistentStore store, Result ins) {
RowSetNavigator nav = ins.initialiseNavigator();
while (nav.hasNext()) {
Object[] data = (Object[]) nav.getNext();
Object[] newData = (Object[]) ArrayUtil.resizeArrayIfDifferent(data, getColumnCount());
insertData(store, newData);
}
}
示例10: 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 = 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" already 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 containing 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);
}
示例11: 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);
}
示例12: 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);
}
示例13: fireAfterTriggers
import org.hsqldb.navigator.RowSetNavigator; //导入方法依赖的package包/类
void fireAfterTriggers(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()) {
//
}
if (td.isForEachRow()) {
while (rowSet.hasNext()) {
Object[] oldData = null;
Object[] newData = null;
switch (td.triggerType) {
case Trigger.DELETE_AFTER_ROW:
oldData = rowSet.getNext();
if (!sqlTrigger) {
oldData = (Object[]) ArrayUtil.duplicateArray(oldData);
}
break;
case Trigger.INSERT_AFTER_ROW:
newData = rowSet.getNext();
if (!sqlTrigger) {
newData = (Object[]) ArrayUtil.duplicateArray(newData);
}
break;
}
td.pushPair(session, oldData, newData);
}
rowSet.beforeFirst();
} else {
td.pushPair(session, null, null);
}
}
}
示例14: getResult
import org.hsqldb.navigator.RowSetNavigator; //导入方法依赖的package包/类
/**
* Executes an INSERT_SELECT statement. It is assumed that the argument
* is of the correct type.
*
* @return the result of executing the statement
*/
Result getResult(Session session) {
Table table = baseTable;
Result resultOut = null;
RowSetNavigator generatedNavigator = null;
PersistentStore store = session.sessionData.getRowStore(baseTable);
if (generatedIndexes != null) {
resultOut = Result.newUpdateCountResult(generatedResultMetaData,
0);
generatedNavigator = resultOut.getChainedResult().getNavigator();
}
RowSetNavigator newDataNavigator = queryExpression == null
? getInsertValuesNavigator(session)
: getInsertSelectNavigator(session);
Expression checkCondition = null;
RangeIteratorBase checkIterator = null;
if (targetTable != baseTable) {
QuerySpecification select =
((TableDerived) targetTable).getQueryExpression()
.getMainSelect();
checkCondition = select.checkQueryCondition;
if (checkCondition != null) {
checkIterator = select.rangeVariables[0].getIterator(session);
}
}
while (newDataNavigator.hasNext()) {
Object[] data = newDataNavigator.getNext();
if (checkCondition != null) {
checkIterator.currentData = data;
boolean check = checkCondition.testCondition(session);
if (!check) {
throw Error.error(ErrorCode.X_44000);
}
}
table.insertRow(session, store, data);
if (generatedNavigator != null) {
Object[] generatedValues = getGeneratedColumns(data);
generatedNavigator.add(generatedValues);
}
}
newDataNavigator.beforeFirst();
table.fireAfterTriggers(session, Trigger.INSERT_AFTER,
newDataNavigator);
if (resultOut == null) {
resultOut =
Result.getUpdateCountResult(newDataNavigator.getSize());
} else {
resultOut.setUpdateCount(newDataNavigator.getSize());
}
return resultOut;
}
示例15: writeSingleColumnResult
import org.hsqldb.navigator.RowSetNavigator; //导入方法依赖的package包/类
protected void writeSingleColumnResult(Result r) throws IOException {
RowSetNavigator nav = r.initialiseNavigator();
while (nav.hasNext()) {
Object[] data = nav.getNext();
writeLogStatement(currentSession, (String) data[0]);
}
}