Package oracle.olapi.data.source

Examples of oracle.olapi.data.source.SpecifiedCursorManager


    prepareAndCommit();

    // Create a Cursor for unitsForSelections.
    CursorManagerSpecification cursorMngrSpec =
            dp.createCursorManagerSpecification(unitsForSelections);
    SpecifiedCursorManager cursorMngr =
            dp.createCursorManager(cursorMngrSpec);
    Cursor unitsForSelCursor = cursorMngr.createCursor();

    // Send the Cursor to a method that does different operations.
    // depending on whether the Cursor is a CompoundCursor or a
    // ValueCursor.
    getContext().printCursor(unitsForSelCursor);
    cursorMngr.close();
    // ...the remaining code of someMethod...
   
    // For the code for the printCursor and _printTuple methods, see
    // the oracle.olapi.examples.CursorPrintWriter class.
  }
View Full Code Here


    prepareAndCommit();

    // Create a Cursor for unitPriceByMonth.
    CursorManagerSpecification cursorMngrSpec =
            dp.createCursorManagerSpecification(unitPriceByMonth);
    SpecifiedCursorManager cursorMngr =
            dp.createCursorManager(cursorMngrSpec);
   
    CompoundCursor rootCursor = (CompoundCursor) cursorMngr.createCursor();

    // Determine a starting position and the number of rows to display.
    int start = 7;
    int numRows = 12;
   
    println("Month     Product     Unit Price");
    println("-----     -------     ----------");

    // Iterate through the specified positions of the root CompoundCursor.
    // Assume that the Cursor contains at least (start + numRows) positions.
    for(int pos = start; pos < start + numRows; pos++)
    {
      // Set the position of the root CompoundCursor.
      rootCursor.setPosition(pos);

      // Print the local values of the output and base ValueCursors.
      // The getLocalValue method gets the local value from the unique
      // value of a dimension element.
      String timeValue = ((ValueCursor)rootCursor.getOutputs().get(0))
                          .getCurrentString();
      String timeLocVal = getContext().getLocalValue(timeValue);
      String prodValue = ((ValueCursor)rootCursor.getOutputs().get(1))
                          .getCurrentString();
      String prodLocVal = getContext().getLocalValue(prodValue);
      Object price = rootCursor.getValueCursor().getCurrentValue();
      println("  " + timeLocVal + sp9 + prodLocVal + sp9 +  price);
    }
    cursorMngr.close();

    return unitPriceByMonth;
  }
View Full Code Here

    prepareAndCommit();

    // Create a Cursor for unitPriceByMonth.
    CursorManagerSpecification cursorMngrSpec =
            dp.createCursorManagerSpecification(unitPriceByMonth);
    SpecifiedCursorManager cursorMngr =
            dp.createCursorManager(cursorMngrSpec);
    CompoundCursor rootCursor = (CompoundCursor) cursorMngr.createCursor();

    // Get the outputs and the ValueCursor.
    List outputs = rootCursor.getOutputs();
    // The first output has the values of timeSel, the slower varying output.
    ValueCursor rowCursor = (ValueCursor) outputs.get(0);
    // The second output has the faster varying values of prodSel.
    ValueCursor columnCursor = (ValueCursor) outputs.get(1);
    // The base ValueCursor has the values from unitPrice.
    ValueCursor unitPriceValues = rootCursor.getValueCursor();

    // Display the values as a crosstab.
    println("\t        PRODUCT_AW");
    println("\t-----------------------");
    print("Month");
    do
    {
      String value = ((ValueCursor) columnCursor).getCurrentString();
      print("\t" + getContext().getLocalValue(value) + "  ");
    }
    while (columnCursor.next());
    println("\n-----\t-------\t-------\t-------");

    // Reset the column Cursor to its first element.
    columnCursor.setPosition(1);

    do
    {
      // Print the row dimension values.
      String value = ((ValueCursor) rowCursor).getCurrentString();
      print(getContext().getLocalValue(value) + "\t");
      // Loop over columns.
      do
      {
        // Print the data value.
        print(unitPriceValues.getCurrentValue() + "\t");
      }
      while (columnCursor.next());

      println();

      // Reset the column Cursor to its first element.
      columnCursor.setPosition(1);
    }
    while (rowCursor.next());

    cursorMngr.close();
  }
View Full Code Here

    println("\nCreating a Cursor");

    prepareAndCommit();
    CursorManagerSpecification cursorMngrSpec =
                 dp.createCursorManagerSpecification(querySource);
    SpecifiedCursorManager cursorMngr =
                 dp.createCursorManager(cursorMngrSpec);
    Cursor queryCursor = cursorMngr.createCursor();

    // Use the Cursor in some way, such as to display its values.
    getContext().displayCursor(queryCursor);

    cursorMngr.close();
  }
View Full Code Here

    Source prodSource = mdmProdHier.getSource();
    // Because prodSource is a primary Source, you do not need to
    // prepare and commit the current Transaction.
    CursorManagerSpecification cursorMngrSpec =
                 dp.createCursorManagerSpecification(prodSource);
    SpecifiedCursorManager cursorMngr =
                 dp.createCursorManager(cursorMngrSpec);
    // Because the Source has no outputs, the Cursor for it
    // is a ValueCursor.
    ValueCursor prodValues = (ValueCursor) cursorMngr.createCursor();
    // Set the position to the fifth element of the ValueCursor.
    prodValues.setPosition(5);

    // Product values are strings. Get the String value at the
    // current position.
View Full Code Here

    prepareAndCommit();

    // Create a Cursor for unitsForSelections.
    CursorManagerSpecification cursorMngrSpec =
                   dp.createCursorManagerSpecification(unitsForSelections);
    SpecifiedCursorManager cursorMngr =
                   dp.createCursorManager(cursorMngrSpec);
    CompoundCursor unitsForSelCursor =
                   (CompoundCursor) cursorMngr.createCursor();

    // Get the base ValueCursor.
    ValueCursor specifiedUnitsVals = unitsForSelCursor.getValueCursor();

    // Get the outputs.
    List outputs = unitsForSelCursor.getOutputs();
    ValueCursor chanSelVals = (ValueCursor) outputs.get(0);
    ValueCursor timeSelVals = (ValueCursor) outputs.get(1);
    ValueCursor custSelVals = (ValueCursor) outputs.get(2);
    ValueCursor prodSelVals = (ValueCursor) outputs.get(3);

    // You can now get the values from the ValueCursor objects.
    // When you have finished using the Cursor objects, close the
    // SpecifiedCursorManager.
    int i = 1;
    do
    {
      println(i + ": " +
              chanSelVals.getCurrentString() + ", " +
              timeSelVals.getCurrentString() + ", " +
              custSelVals.getCurrentString() + ", " +
              prodSelVals.getCurrentString() + ", " +
              specifiedUnitsVals.getCurrentValue());
      i++;
    }
    while(unitsForSelCursor.next());

    cursorMngr.close();

    // Create an ArrayList of the Source objects for use by other examples.
    ArrayList sourcesFromExample4 = new ArrayList();
    sourcesFromExample4.add(units);
    sourcesFromExample4.add(prodSel);
View Full Code Here

    prepareAndCommit();

    // Create a Cursor for unitsForSelections.
    CursorManagerSpecification cursorMngrSpec =
            dp.createCursorManagerSpecification(unitsForSelections);
    SpecifiedCursorManager cursorMngr =
            dp.createCursorManager(cursorMngrSpec);
    Cursor unitsForSelCursor = cursorMngr.createCursor();

    // Send the Cursor to a method that does different operations.
    // depending on whether the Cursor is a CompoundCursor or a
    // ValueCursor.
    getContext().printCursor(unitsForSelCursor);
    cursorMngr.close();
    // ...the remaining code of someMethod...
   
    // For the code for the printCursor and _printTuple methods, see
    // the oracle.olapi.examples.CursorPrintWriter class.
  }
View Full Code Here

    prepareAndCommit();

    // Create a Cursor for unitPriceByMonth.
    CursorManagerSpecification cursorMngrSpec =
            dp.createCursorManagerSpecification(unitPriceByMonth);
    SpecifiedCursorManager cursorMngr =
            dp.createCursorManager(cursorMngrSpec);
   
    CompoundCursor rootCursor = (CompoundCursor) cursorMngr.createCursor();

    // Determine a starting position and the number of rows to display.
    int start = 7;
    int numRows = 12;
   
    println("Month     Product     Unit Price");
    println("-----     -------     ----------");

    // Iterate through the specified positions of the root CompoundCursor.
    // Assume that the Cursor contains at least (start + numRows) positions.
    for(int pos = start; pos < start + numRows; pos++)
    {
      // Set the position of the root CompoundCursor.
      rootCursor.setPosition(pos);

      // Print the local values of the output and base ValueCursors.
      // The getLocalValue method gets the local value from the unique
      // value of a dimension element.
      String timeValue = ((ValueCursor)rootCursor.getOutputs().get(0))
                          .getCurrentString();
      String timeLocVal = getContext().getLocalValue(timeValue);
      String prodValue = ((ValueCursor)rootCursor.getOutputs().get(1))
                          .getCurrentString();
      String prodLocVal = getContext().getLocalValue(prodValue);
      Object price = rootCursor.getValueCursor().getCurrentValue();
      println("  " + timeLocVal + sp9 + prodLocVal + sp9 +  price);
    }
    cursorMngr.close();

    return unitPriceByMonth;
  }
View Full Code Here

    prepareAndCommit();

    // Create a Cursor for unitPriceByMonth.
    CursorManagerSpecification cursorMngrSpec =
            dp.createCursorManagerSpecification(unitPriceByMonth);
    SpecifiedCursorManager cursorMngr =
            dp.createCursorManager(cursorMngrSpec);
    CompoundCursor rootCursor = (CompoundCursor) cursorMngr.createCursor();

    // Get the outputs and the ValueCursor.
    List outputs = rootCursor.getOutputs();
    // The first output has the values of timeSel, the slower varying output.
    ValueCursor rowCursor = (ValueCursor) outputs.get(0);
    // The second output has the faster varying values of prodSel.
    ValueCursor columnCursor = (ValueCursor) outputs.get(1);
    // The base ValueCursor has the values from unitPrice.
    ValueCursor unitPriceValues = rootCursor.getValueCursor();

    // Display the values as a crosstab.
    println("\t        PRODUCT_AW");
    println("\t-----------------------");
    print("Month");
    do
    {
      String value = ((ValueCursor) columnCursor).getCurrentString();
      print("\t" + getContext().getLocalValue(value) + "  ");
    }
    while (columnCursor.next());
    println("\n-----\t-------\t-------\t-------");

    // Reset the column Cursor to its first element.
    columnCursor.setPosition(1);

    do
    {
      // Print the row dimension values.
      String value = ((ValueCursor) rowCursor).getCurrentString();
      print(getContext().getLocalValue(value) + "\t");
      // Loop over columns.
      do
      {
        // Print the data value.
        print(unitPriceValues.getCurrentValue() + "\t");
      }
      while (columnCursor.next());

      println();

      // Reset the column Cursor to its first element.
      columnCursor.setPosition(1);
    }
    while (rowCursor.next());

    cursorMngr.close();
  }
View Full Code Here

    prepareAndCommit();

    // Create a Cursor for unitsForSelections.
    CursorManagerSpecification cursorMngrSpec =
            dp.createCursorManagerSpecification(unitsForSelections);
    SpecifiedCursorManager cursorMngr =
            dp.createCursorManager(cursorMngrSpec);
    CompoundCursor unitsForSelCursor = (CompoundCursor) cursorMngr.createCursor();

    // Display the results in a crosstab.
    getContext().printAsCrosstab(unitsForSelCursor);
   
    // For the printAsCrosstab method, see the CursorPrintWriter class.
    cursorMngr.close();
  }
View Full Code Here

TOP

Related Classes of oracle.olapi.data.source.SpecifiedCursorManager

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.