prepareAndCommit();
// Create the Cursor. The DataProvider is dp.
CursorManagerSpecification cursorMngrSpec =
dp.createCursorManagerSpecification(querySource2);
CursorManager cursorManager =
dp.createCursorManager(cursorMngrSpec);
Cursor queryCursor2 = cursorManager.createCursor();
// Get the ValueCursor and the outputs.
CompoundCursor rootCursor = (CompoundCursor) queryCursor2;
ValueCursor baseValueCursor = rootCursor.getValueCursor();
List outputs = rootCursor.getOutputs();
ValueCursor output1 = (ValueCursor) outputs.get(0);
String sp6 = " ";
String sp7 = sp6 + " ";
String sp13 = sp6 + sp7;
// Get the positions and values and display them.
println("CompoundCursor Output ValueCursor" + " ValueCursor");
println(" position position | value position | value");
do
{
println(sp6 + rootCursor.getPosition() + // sp6 is 6 spaces
sp13 + output1.getPosition() + // sp13 is 13 spaces
sp7 + getLocalValue(output1.getCurrentString()) + // sp7 is 7 spaces
sp7 + baseValueCursor.getPosition() +
sp7 + getLocalValue(baseValueCursor.getCurrentString()));
}
while(queryCursor2.next());
cursorManager.close();
}