Oracle OLAP Java API Reference
10g Release 1 (10.1)

B10994-01

oracle.olapi.data.source
Class DataProvider

java.lang.Object
  |
  +--oracle.olapi.data.source.DataProvider
Direct Known Subclasses:
ExpressDataProvider

public abstract class DataProvider
extends java.lang.Object

Provides access to a data store. Each DataProvider is associated with an oracle.jdbc.OracleConnection and a TransactionProvider. ExpressDataProvider, the concrete subclass of DataProvider, provides access to the actual data of an Oracle data store. After you create a new ExpressDataProvider, you must call its initialize method before you can use it.

The DataProvider class includes methods that do the following.

For the createListSource methods, the values of the elements array must be unique. The array cannot contain duplicate values.

You can specify any number of values in the elements array. However, since the efficiency of a Source returned by a createListSource method decreases as the size of the elements array increases, Oracle recommends that you create large lists in the underlying data store.

The Source objects returned by the createConstantSource and createListSource methods each has an associated ConstantListDefinition that contains its definition. The Source objects returned by the createRangeSource methods each has an associated RangeDefinition that contains its definition.

See Also:
Source

Method Summary
abstract  void close()
          Closes the DataProvider and releases resources associated with it.
 BooleanSource createConstantSource(boolean element)
          Creates a BooleanSource that has only one element, which has the specified boolean value.
 DateSource createConstantSource(java.util.Date element)
          Creates a DateSource that has only one element, which has the specified Date value.
 NumberSource createConstantSource(double element)
          Creates a NumberSource that has only one element, which has the specified double value.
 NumberSource createConstantSource(float element)
          Creates a NumberSource that has only one element, which has the specified float value.
 NumberSource createConstantSource(int element)
          Creates a NumberSource that has only one element, which has the specified int value.
 NumberSource createConstantSource(short element)
          Creates a NumberSource that has only one element, which has the specified short value.
 Source createConstantSource(Source element)
          Creates a Source that has only one element, which has the specified Source value.
 StringSource createConstantSource(java.lang.String element)
          Creates a StringSource that has only one element, which has the specified String value.
 CursorInfoSpecification createCursorInfoSpecification(Source rootSource)
          Creates a CursorInfoSpecification for the specified Source.
 SpecifiedCursorManager createCursorManager(CursorManagerSpecification cursorManagerSpecification)
          Creates a CursorManager based on a CursorManagerSpecification.
abstract  SpecifiedCursorManager createCursorManager(CursorManagerSpecification cursorManagerSpecification, Source[] inputSources)
          Creates a CursorManager based on a CursorManagerSpecification and an array of Source objects.
 CursorManager createCursorManager(Source rootSource)
          Creates a CursorManager for the specified Source.
 CursorManager createCursorManager(Source rootSource, int fetchSize, CursorInfoSpecification cursorInfoSpec)
          Creates a CursorManager object for the specified Source with the specified CursorInfoSpecification that has the specified fetch size.
 CursorManager[] createCursorManagers(Source[] rootSources)
          Creates an array of CursorManager objects, one for each of the corresponding Source in the rootSources array.
abstract  CursorManager[] createCursorManagers(Source[] rootSource, int[] fetchSize, CursorInfoSpecification[] cursorInfoSpec)
          Creates an array of CursorManager objects for the specified Source objects with the specified CursorInfoSpecification objects that have the specified fetch sizes.
 CursorManagerSpecification createCursorManagerSpecification(Source rootSource)
          Creates a CursorManagerSpecification based on a Source object.
 BooleanSource createListSource(boolean[] elements)
          Creates a BooleanSource with elements that have the specified boolean values.
 DateSource createListSource(java.util.Date[] elements)
          Creates a DateSource with elements that have the specified Date values.
 NumberSource createListSource(double[] elements)
          Creates a NumberSource with elements that have the specified double values.
 NumberSource createListSource(float[] elements)
          Creates a NumberSource with elements that have the specified float values.
 NumberSource createListSource(int[] elements)
          Creates a NumberSource with elements that have the specified int values.
 NumberSource createListSource(short[] elements)
          Creates a NumberSource with elements that have the specified short values.
 Source createListSource(Source[] elements)
          Creates a Source with elements that have the specified Source objects as values.
 StringSource createListSource(java.lang.String[] elements)
          Creates a StringSource with elements that have the specified String values.
 BooleanSource createParameterizedSource(BooleanParameter param)
          Creates a parameterized BooleanSource that has the value of the specified BooleanParameter as the value of its element.
 DateSource createParameterizedSource(DateParameter param)
          Creates a parameterized DateSource that has the value of the specified DateParameter as the value of its element.
 NumberSource createParameterizedSource(NumberParameter param)
          Creates a parameterized NumberSource that has the value of the specified NumberParameter as the value of its element.
 StringSource createParameterizedSource(StringParameter param)
          Creates a parameterized StringSource that has the value of the specified StringParameter as the value of its element.
 NumberSource createRangeSource(int bottom, int top)
          Creates a NumberSource with elements that have consecutive int values that range from the specified lowest value to the specified highest value.
 NumberSource createRangeSource(int bottom, NumberSource top)
          Creates a NumberSource with elements that have consecutive int values that range from the specified lowest value to the specified highest value.
 NumberSource createRangeSource(NumberSource bottom, int top)
          Creates a NumberSource with elements that have consecutive int values that range from the specified lowest value to the specified highest value.
 NumberSource createRangeSource(NumberSource bottom, NumberSource top)
          Creates a NumberSource with elements that have consecutive int values that range from the specified lowest value to the specified highest value.
 SQLCursorManager createSQLCursorManager(Source source)
          Creates a SQLCursorManager for the specified Source.
abstract  SQLCursorManager[] createSQLCursorManagers(Source[] sources)
          Creates an array of SQLCursorManager objects that has one SQLCursorManager for each of the specified Source objects.
 Source getEmptySource()
          Gets the empty Source, which does not have any elements.
 FundamentalMetadataProvider getFundamentalMetadataProvider()
          Gets the FundamentalMetadataProvider for this DataProvider.
 TransactionProvider getTransactionProvider()
          Gets the TransactionProvider for this DataProvider.
 Source getVoidSource()
          Gets the void Source object, which has a single element that has null as its value.
abstract  void initialize()
          Initializes this DataProvider.
abstract  boolean isOpen()
          Indicates whether the connection to the data store is currently open.

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Method Detail

close

public abstract void close()
Closes the DataProvider and releases resources associated with it.

createConstantSource

public final NumberSource createConstantSource(double element)
Creates a NumberSource that has only one element, which has the specified double value.
Parameters:
element - The double value that you want the returned NumberSource to have.
Returns:
A NumberSource that has the specified double value.

createConstantSource

public final NumberSource createConstantSource(float element)
Creates a NumberSource that has only one element, which has the specified float value.
Parameters:
element - The float value that you want the returned NumberSource to have.
Returns:
A NumberSource that has the specified float value.

createConstantSource

public final NumberSource createConstantSource(int element)
Creates a NumberSource that has only one element, which has the specified int value.
Parameters:
element - The int value that you want the returned NumberSource to have.
Returns:
A NumberSource that has the specified int value.

createConstantSource

public final StringSource createConstantSource(java.lang.String element)
Creates a StringSource that has only one element, which has the specified String value.
Parameters:
element - The String value that you want the returned StringSource to have.
Returns:
A StringSource that has the specified String value.

createConstantSource

public final DateSource createConstantSource(java.util.Date element)
Creates a DateSource that has only one element, which has the specified Date value.
Parameters:
element - The Date value that you want the returned DateSource to have.
Returns:
A DateSource that has the specified Date value.

createConstantSource

public final Source createConstantSource(Source element)
Creates a Source that has only one element, which has the specified Source value.
Parameters:
element - The Source that you want as the value of the element of the returned Source to have.
Returns:
A Source that has an element that has the specified Source as its value.

createConstantSource

public final NumberSource createConstantSource(short element)
Creates a NumberSource that has only one element, which has the specified short value.
Parameters:
element - The short value that you want the returned NumberSource to have.
Returns:
A NumberSource that has the specified short value.

createConstantSource

public final BooleanSource createConstantSource(boolean element)
Creates a BooleanSource that has only one element, which has the specified boolean value.
Parameters:
element - The boolean value that you want the returned BooleanSource to have.
Returns:
A BooleanSource that has the specified boolean value.

createCursorManager

public final SpecifiedCursorManager createCursorManager(CursorManagerSpecification cursorManagerSpecification)
                                                 throws CursorManagerSpecificationExpiredException
Creates a CursorManager based on a CursorManagerSpecification. You use a CursorManager to create Cursor objects, which provide access to the results of a query.

Use this method if the Source that you used to create the CursorManagerSpecification has no inputs. If the Source has inputs, then use the createCursorManager(CursorManagerSpecification cursorManagerSpecification, Source[] inputSources) method.

Parameters:
cursorManagerSpecification - The CursorManagerSpecification for the Source for which you want to create a Cursor.
Returns:
A SpecifiedCursorManager for the Source for which you want to create a Cursor.

createCursorManager

public abstract SpecifiedCursorManager createCursorManager(CursorManagerSpecification cursorManagerSpecification,
Source[] inputSources)
                                                    throws CursorManagerSpecificationExpiredException
Creates a CursorManager based on a CursorManagerSpecification and an array of Source objects. You use a CursorManager to create Cursor objects, which provide access to the results of a query.

Use this method if the Source that you used to create the CursorManagerSpecification has inputs. With the inputSources argument, you specify Source objects for the inputs of the Source used to create the CursorManagerSpecification. If the Source does not have inputs, then use the createCursorManager(CursorManagerSpecification cursorManagerSpecification) method.

A Source that you include in inputSources must not have any inputs itself and it must not have any outputs. It must specify a single set of values. When you create a Cursor from the CursorManager, you use CursorInput objects to specify values for the input Source objects.

You can discover the inputs of the Source used to create the CursorManagerSpecification by doing the following:

  1. On the CursorManagerSpecification, call the getRootCursorSpecification method.
  2. On the CursorSpecification returned, call the getSource method.
  3. On the Source returned, call the getInputs method.
Parameters:
cursorManagerSpecification - The CursorManagerSpecification for the Source for which you want to create a Cursor.
inputSources - An array of Source objects, one for each input of the Source for the CursorManagerSpecification.
Returns:
A SpecifiedCursorManager for the Source for which you want to create a Cursor.

createCursorManager

public final CursorManager createCursorManager(Source rootSource)
Creates a CursorManager for the specified Source.
Parameters:
rootSource - The Source for which you want a CursorManager.
Returns:
The CursorManager for the specified Source.

createCursorManagers

public final CursorManager[] createCursorManagers(Source[] rootSources)
Creates an array of CursorManager objects, one for each of the corresponding Source in the rootSources array.
Parameters:
rootSources - The Source objects for which you want CursorManager objects.
Returns:
The CursorManager objects for the specified Source objects.

createCursorManager

public final CursorManager createCursorManager(Source rootSource,
                                               int fetchSize,
CursorInfoSpecification cursorInfoSpec)
Creates a CursorManager object for the specified Source with the specified CursorInfoSpecification that has the specified fetch size. A fetch size of -1 specifies fetching the entire result set.
Parameters:
rootSource - A Source for which you want a CursorManager.
fetchSize - An integer that specifies the fetch size for the Cursor objects created by the CursorManager.
cursorInfoSpec - A CursorInfoSpecification for the CursorManager.
Returns:
A CursorManager for the Source.

createCursorManagers

public abstract CursorManager[] createCursorManagers(Source[] rootSource,
                                                     int[] fetchSize,
CursorInfoSpecification[] cursorInfoSpec)
Creates an array of CursorManager objects for the specified Source objects with the specified CursorInfoSpecification objects that have the specified fetch sizes. The array contains one CursorManager for each Source in the rootSource array. The fetchSize and cursorInfoSpec arrays supply a fetch size and a CursorInfoSpecification for the CursorManager for the corresponding Source in the rootSource array. A fetch size of -1 specifies fetching the entire result set.
Parameters:
rootSource - An array of Source objects for which you want CursorManager objects.
fetchSize - An array of integers that specify the fetch sizes for the Cursor objects created by the corresponding CursorManager objects.
cursorInfoSpec - An array of CursorInfoSpecification objects for the corresponding CursorManager objects.
Returns:
An array of CursorManager objects for the corresponding Source objects.

createCursorInfoSpecification

public final CursorInfoSpecification createCursorInfoSpecification(Source rootSource)
                                                            throws TransactionalObjectInvalidException
Creates a CursorInfoSpecification for the specified Source.
Parameters:
rootSource - The Source for which you want a CursorInfoSpecification.
Returns:
The CursorInfoSpecification for the specified Source.

createCursorManagerSpecification

public final CursorManagerSpecification createCursorManagerSpecification(Source rootSource)
                                                                  throws TransactionalObjectInvalidException
Creates a CursorManagerSpecification based on a Source object. You can use the CursorManagerSpecification to create CursorManager objects. The CursorManagerSpecification specifies the behavior of Cursor objects that you create from a CursorManager.
Parameters:
rootSource - A Source that defines a query to make on the data source.
Returns:
A CursorManagerSpecification for the Source for which you want to create a Cursor.

createListSource

public final NumberSource createListSource(double[] elements)
Creates a NumberSource with elements that have the specified double values.
Parameters:
elements - An array of double values.
Returns:
A NumberSource with elements that have the specified double values.

createListSource

public final NumberSource createListSource(float[] elements)
Creates a NumberSource with elements that have the specified float values.
Parameters:
elements - An array of float values.
Returns:
A NumberSource with elements that have the specified float values.

createListSource

public final NumberSource createListSource(int[] elements)
Creates a NumberSource with elements that have the specified int values.
Parameters:
elements - An array of int values.
Returns:
A NumberSource with elements that have the specified int values.

createListSource

public final StringSource createListSource(java.lang.String[] elements)
Creates a StringSource with elements that have the specified String values.
Parameters:
elements - An array of String values.
Returns:
A StringSource with elements that have the specified String values.

createListSource

public final DateSource createListSource(java.util.Date[] elements)
Creates a DateSource with elements that have the specified Date values.
Parameters:
elements - An array of Date values.
Returns:
A DateSource with elements that have the specified Date values.

createListSource

public final Source createListSource(Source[] elements)
Creates a Source with elements that have the specified Source objects as values.
Parameters:
elements - An array of Source objects.
Returns:
A Source with elements that have the specified Date values.

createListSource

public final NumberSource createListSource(short[] elements)
Creates a NumberSource with elements that have the specified short values.
Parameters:
elements - An array of short values.
Returns:
A NumberSource with elements that have the specified short values.

createListSource

public final BooleanSource createListSource(boolean[] elements)
Creates a BooleanSource with elements that have the specified boolean values.
Parameters:
elements - An array of boolean values.
Returns:
A BooleanSource with elements that have the specified boolean values.

createParameterizedSource

public final StringSource createParameterizedSource(StringParameter param)
Creates a parameterized StringSource that has the value of the specified StringParameter as the value of its element.
Parameters:
param - A StringParameter that supplies the value of the element of the StringSource returned by this method.
Returns:
A StringSource whose element has the current value of the specified StringParameter.

createParameterizedSource

public final DateSource createParameterizedSource(DateParameter param)
Creates a parameterized DateSource that has the value of the specified DateParameter as the value of its element.
Parameters:
param - A DateParameter that supplies the value of the element of the DateSource returned by this method.
Returns:
A DateSource whose element has the current value of the specified DateParameter.

createParameterizedSource

public final BooleanSource createParameterizedSource(BooleanParameter param)
Creates a parameterized BooleanSource that has the value of the specified BooleanParameter as the value of its element.
Parameters:
param - A BooleanParameter that supplies the value of the element of the BooleanSource returned by this method.
Returns:
A BooleanSource whose element has the current value of the specified BooleanParameter.

createParameterizedSource

public final NumberSource createParameterizedSource(NumberParameter param)
Creates a parameterized NumberSource that has the value of the specified NumberParameter as the value of its element.
Parameters:
param - A NumberParameter that supplies the value of the element of the NumberSource returned by this method.
Returns:
A NumberSource whose element has the current value of the specified NumberParameter.

createRangeSource

public final NumberSource createRangeSource(int bottom,
                                            int top)
Creates a NumberSource with elements that have consecutive int values that range from the specified lowest value to the specified highest value.
Parameters:
bottom - The lowest value that you want the returned NumberSource to have.
top - The highest value that you want the returned NumberSource to have.
Returns:
A NumberSource that has the specified range of values.

createRangeSource

public final NumberSource createRangeSource(int bottom,
NumberSource top)
Creates a NumberSource with elements that have consecutive int values that range from the specified lowest value to the specified highest value.
Parameters:
bottom - The lowest value that you want the returned NumberSource to have.
top - A NumberSource with a single element, which has the int value that you want as the highest value of the returned NumberSource.
Returns:
A NumberSource that has the specified range of values.

createRangeSource

public final NumberSource createRangeSource(NumberSource bottom,
                                            int top)
Creates a NumberSource with elements that have consecutive int values that range from the specified lowest value to the specified highest value.
Parameters:
bottom - A NumberSource with a single element, which has the int value that you want as the lowest value of the returned NumberSource.
top - The highest value that you want the returned NumberSource to have.
Returns:
A NumberSource that has the specified range of values.

createRangeSource

public final NumberSource createRangeSource(NumberSource bottom,
NumberSource top)
Creates a NumberSource with elements that have consecutive int values that range from the specified lowest value to the specified highest value.
Parameters:
bottom - A NumberSource with a single element, which has the int value that you want as the lowest value of the returned NumberSource.
top - A NumberSource with a single element, which has the int value that you want as the highest value of the returned NumberSource.
Returns:
A NumberSource that has the specified range of values.

getEmptySource

public final Source getEmptySource()
Gets the empty Source, which does not have any elements. The empty Source represents an empty result set.
Returns:
The empty Source.

getFundamentalMetadataProvider

public final FundamentalMetadataProvider getFundamentalMetadataProvider()
Gets the FundamentalMetadataProvider for this DataProvider. The FundamentalMetadataProvider provides FundamentalMetadataObject objects that represent Oracle OLAP data types. You can use FundamentalMetadataObject objects to create derived Source objects or instances of custom MtmObject objects.
Returns:
The FundamentalMetadataProvider for this DataProvider.

getTransactionProvider

public final TransactionProvider getTransactionProvider()
Gets the TransactionProvider for this DataProvider.
Returns:
The TransactionProvider for this DataProvider.

getVoidSource

public final Source getVoidSource()
Gets the void Source object, which has a single element that has null as its value.
Returns:
The void Source.

initialize

public abstract void initialize()
                         throws java.sql.SQLException
Initializes this DataProvider. Always call this method after creating a new DataProvider.

This method throws a java.sql.SQLException if an error occurs when Oracle OLAP is preparing for its interactions with the database.


isOpen

public abstract boolean isOpen()
Indicates whether the connection to the data store is currently open.
Returns:
true when the connection to the data store is open or false when it is not.

createSQLCursorManager

public final SQLCursorManager createSQLCursorManager(Source source)
                                              throws TransactionalObjectInvalidException
Creates a SQLCursorManager for the specified Source. From the SQLCursorManager you can obtain the SQL statement that Oracle OLAP generates for the Source.
Parameters:
source - A Source that specifies a query.
Returns:
A SQLCursorManager that has the SQL statement generated for the specified Source.

createSQLCursorManagers

public abstract SQLCursorManager[] createSQLCursorManagers(Source[] sources)
Creates an array of SQLCursorManager objects that has one SQLCursorManager for each of the specified Source objects. From each SQLCursorManager you can obtain the SQL statement that Oracle OLAP generates for its Source. All of the Source objects in the sources array must be active in the same Transaction.
Parameters:
sources - An array of Source objects from the same Transaction.
Returns:
An array of SQLCursorManager objects that have the SQL statements generated for the specified Source objects. .

Oracle OLAP Java API Reference
10g Release 1 (10.1)

B10994-01

Copyright © 2002, 2003, Oracle. All Rights Reserved.