本文整理汇总了Java中org.hsqldb.navigator.RowSetNavigator.hasNext方法的典型用法代码示例。如果您正苦于以下问题:Java RowSetNavigator.hasNext方法的具体用法?Java RowSetNavigator.hasNext怎么用?Java RowSetNavigator.hasNext使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.hsqldb.navigator.RowSetNavigator
的用法示例。
在下文中一共展示了RowSetNavigator.hasNext方法的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: 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;
}
示例3: 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) {}
}
}
示例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 = nav.getNext();
Object[] newData =
(Object[]) ArrayUtil.resizeArrayIfDifferent(data, columnCount);
insertData(session, store, newData);
}
}
示例5: insertSys
import org.hsqldb.navigator.RowSetNavigator; //导入方法依赖的package包/类
/**
* Used for system table inserts. No checks. No identity
* columns.
*/
public int insertSys(Session session, PersistentStore store, Result ins) {
RowSetNavigator nav = ins.getNavigator();
int count = 0;
while (nav.hasNext()) {
insertSys(session, store, nav.getNext());
count++;
}
return count;
}
示例6: 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);
}
}
示例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];
if (j == this.overrideUserValue) {
continue;
}
Type sourceType = sourceTypes[i];
data[j] = colTypes[j].convertToType(session, sourceData[i],
sourceType);
}
newData.add(data);
}
return newData;
}
示例8: deleteRows
import org.hsqldb.navigator.RowSetNavigator; //导入方法依赖的package包/类
void deleteRows(Session session, Table table, RowSetNavigator oldRows) {
while (oldRows.hasNext()) {
oldRows.next();
Row row = oldRows.getCurrentRow();
if (!row.isDeleted(session)) {
table.deleteNoRefCheck(session, row);
}
}
}
示例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: 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);
}
}
示例11: 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);
}
}
示例12: insertSys
import org.hsqldb.navigator.RowSetNavigator; //导入方法依赖的package包/类
/**
* Used for system table inserts. No checks. No identity columns.
*/
public int insertSys(PersistentStore store, Result ins) {
RowSetNavigator nav = ins.getNavigator();
int count = 0;
while (nav.hasNext()) {
insertSys(store, (Object[]) nav.getNext());
count++;
}
return count;
}
示例13: 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);
}
示例14: 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);
}
示例15: 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);
}
}
}