diff --git a/build.xml b/build.xml index 9223094..6e9873a 100644 --- a/build.xml +++ b/build.xml @@ -47,6 +47,8 @@ + + diff --git a/doc/olap4j_fs.html b/doc/olap4j_fs.html index 41f7953..fcf12de 100644 --- a/doc/olap4j_fs.html +++ b/doc/olap4j_fs.html @@ -123,7 +123,7 @@

Contents

  • The OlapParameterMetaData interface
  • The OlapResultSet interface
  • The ResultAxis interface
  • -
  • The Position interface
  • +
  • The ResultPosition interface
  • The ResultCell interface
  • @@ -133,6 +133,7 @@

    Contents

  • Access control
  • Metadata objects
    1. The MetadataElement interface
    2. +
    3. The Database interface
    4. The Catalog interface
    5. The Schema interface
    6. The Cube interface
    7. @@ -381,7 +382,7 @@

      We now describe the olap4j API in more detail, by breaking it down into a set of functional areas.

      -olap4j components +olap4j components

      2.1. Driver management

      @@ -537,7 +538,9 @@

      2.2.2. Connection pooling

      work with the connection pool.

      The problem does not just affect connections: some connection pools also wrap Statement, PreparedStatement, ResultSet -and DatabaseMetaData objects, so there are convert() +and + +DatabaseMetaData objects, so there are convert() methods for these too.

      Hopefully this problem will only be temporary. As olap4j gains popularity, we expect connection pools to add support for the extended interfaces, and it will @@ -606,7 +609,7 @@

      2.3.4. The OlapResultSet interface

      2.3.5. The ResultAxis interface

      A ResultAxis is -a

      +a ...

      [tbd]

      [access positions by index (i.e. a list) and by scrolling (i.e. an iterator)]

      2.3.6. The ResultPosition interface

      @@ -886,13 +889,21 @@
      2.6.2.1. The MetadataElement interfacee
    8. String getCaption(Locale locale)
    9. String getDescription(Locale locale)
    10. -
      2.6.2.2. The Catalog interface
      -

      Catalog ...

      +
      2.6.2.2. The Database interface
      +

      Database +is the root element in a hierarchy of metadata elements.

      +

      Methods:

      +
        +
      • NamedList<Catalog> getCatalogs()
      • +
      +
      2.6.2.3. The Catalog interface
      +

      Catalog +...

      • String getName()
      • NamedList<Schema> getSchemas()
      -
      2.6.2.3. The Schema interface
      +
      2.6.2.4. The Schema interface

      Schema ...

      -
      2.6.2.4. The Cube interface
      +
      2.6.2.5. The Cube interface

      Cube ...

      -
      2.6.2.5. The Dimension interface
      +
      2.6.2.6. The Dimension interface

      Dimension -...

      +(extends +MetadataElement)

      • String getName()
      • List<Hierarchy> getHierarchies()
      • List<Member> getRootMembers()
      • Dimension.Type getDimensionType()
      -
      2.6.2.6. The Hierarchy interface
      -

      Hierarchy +

      2.6.2.7. The Hierarchy interface
      +

      Hierarchy  +(extends +MetadataElement) ...

      • Dimension getDimension()
      • @@ -928,16 +942,20 @@
        2.6.2.6. The Hierarchy interface
      • List<Level> getLevels()
      • boolean hasAll()
      -
      2.6.2.7. The Level interface
      -

      Level ...

      +
      2.6.2.8. The Level interface
      +

      Level  +(extends +MetadataElement) ...

      • int getDepth()
      • Hierarchy getHierarchy()
      • Level.Type getLevelType()
      • List<Property> getProperties()
      -
      2.6.2.8. The Member interface
      -

      Member ...

      +
      2.6.2.9. The Member interface
      +

      Member  +(extends +MetadataElement) ...

      • String getName()
      • List<Member> getChildMembers()
      • @@ -957,13 +975,17 @@
        2.6.2.8. The Member interface
      • boolean isHidden()
      • Member getDataMember()
      -
      2.6.2.9. The Measure interface
      -

      Measure ...

      +
      2.6.2.10. The Measure interface
      +

      Measure  +(extends +MetadataElement) ...

      • extends Member
      -
      2.6.2.10. The Property interface
      -

      Property +

      2.6.2.11. The Property interface
      +

      Property  +(extends +MetadataElement) ...

      • Datatype getType()
      • @@ -976,6 +998,14 @@
        2.6.2.10. The Property interface
        }
      • enum StandardCellProperty { BACK_COLOR, CELL_EVALUATION_LIST, ... }
      +
      2.6.2.12. The NamedSet interface
      +

      NamedSet +(extends +MetadataElement) +...

      +
        +
      • Cube getCube()
      • +

      2.6.3. The OlapDatabaseMetaData interface, and methods which return schema rowsets

      @@ -984,114 +1014,170 @@

      2.6.3. java.sql.DatabaseMetaData) contains methods which return schema result sets.

      Schema result sets are specified as in [XML for Analysis -specification]. Here is a table of the XML/A methods and the corresponding -olap4j method.

      +specification]. Here is a table of the XML/A methods and the corresponding +olap4j method and element type.

      - + + + + + + + + + + + + + + + + + + OlapDatabaseMetaData.getDatasources + + + OlapDatabaseMetaData.getMdxKeywords + + OlapDatabaseMetaData.getLiterals + + OlapDatabaseMetaData.getDatabaseProperties + + + OlapDatabaseMetaData.getActions + + OlapDatabaseMetaData.getCubes + + OlapDatabaseMetaData.getDimensions + + OlapDatabaseMetaData.getFunctions + + OlapDatabaseMetaData.getHierarchies + + + + OlapDatabaseMetaData.getLevels + + OlapDatabaseMetaData.getMeasures + + OlapDatabaseMetaData.getMembers + + OlapDatabaseMetaData.getProperties + + OlapDatabaseMetaData.getSets +
      XML for Analysis schema rowsetOlapDatabaseMetaData methodSchema result set methodMetadata element
      not supported + not supported + Database
      not supported + + DatabaseMetaData.getCatalogs + Catalog
      not supported + + DatabaseMetaData.getSchemas + Schema
      DISCOVER_DATASOURCES - getDatasources + not supported
      DISCOVER_ENUMERATORS not supportednot supported
      DISCOVER_KEYWORDS - getMdxKeywords + not supported
      DISCOVER_LITERALS - getLiterals + not supported
      DISCOVER_PROPERTIES - getDatabaseProperties + not supported
      DISCOVER_SCHEMA_ROWSETS not supportednot supported
      MDSCHEMA_ACTIONS - getActions + not supported
      MDSCHEMA_CUBES - getCubes + Cube
      MDSCHEMA_DIMENSIONS - getDimensions + Dimension
      MDSCHEMA_FUNCTIONS - getFunctions + not supported
      MDSCHEMA_HIERARCHIES - getHierarchies + Hierarchy
      MDSCHEMA_INPUT_DATASOURCES not supportednot supported
      MDSCHEMA_KPIS not supportednot supported
      MDSCHEMA_LEVELS - getLevels + Level
      MDSCHEMA_MEASURES - getMeasures + Measure
      MDSCHEMA_MEMBERS - getMembers + Member
      MDSCHEMA_PROPERTIES - getProperties + Property
      MDSCHEMA_SETS - getSets + NamedSet
      @@ -1119,32 +1205,13 @@

      2.6.3. Type - A description of the data type for the column. + A description of the data type for the column, and whether the + column may be NULL. Description A brief description of the purpose of the column. - - - Restriction - - Indicates whether the column can be used to restrict the - returned rowset by inclusion in the Restrictions - parameter of the Discover method. - Yes means that the column is available to - use as a Restrictions item to filter results - by this field. - - - - Nullable - - Indicates whether the data must be returned or if a null - string is allowed if the column does not apply. Yes - means nulls are allowed, and the data is optional. - No means that the data is required. -

      [Need to clean up data types in the following tables. Types should all be JDBC types.]

      @@ -1154,6 +1221,10 @@

      2.6.3. the ProviderType and AuthenticationMode attributes of getDatasources, and the DIMENSION_TYPE attribute of getDimensions. In some cases those enums already exist, but need to be extended.]

      +

      [Mapping from OLE DB- and XML/A-style column sets to JDBC-style. Types: +DBTYPE_WSTR to String, DBTYPE_GUID to String, DBTYPE_DBTIMESTAMP to Timestamp, +DBTYPE_BOOL to boolean; DBTYPE_I4, DBTYPE_UI4, DBTYPE_I2 and DBTYPE_UI2 all map +to int. Column names: mapped CamelCase to UPPER_CASE.]

      2.6.3.1. getDatasources

      Specified by the DISCOVER_DATASOURCES XML for Analysis method.

      @@ -1161,66 +1232,60 @@
      2.6.3.1. getDatasources
      - - + + - - - + + - - + - + - - + - + - - - + + - - - + + - - + - + - - + - + -
      Column nameTypeColumn nameType DescriptionNullable
      DataSourceNamestringDATA_SOURCE_NAMEString not null The name of the data source, such as FoodMart 2000.No
      DataSourceDescriptionDATA_SOURCE_DESCRIPTIONstringString A description of the data source, as entered by the publisher.Yes
      URLURLstringString The unique path that shows where to invoke the XML for Analysis methods for that data source.Yes
      DataSourceInfostringDATA_SOURCE_INFOString

      A string containing any additional information required to connect to the data source. This can include the Initial Catalog property or other information for the provider.

      Example: "Provider=MSOLAP;Data Source=Local;"

      Yes
      ProviderNamestringPROVIDER_NAMEString

      The name of the provider behind the data source.

      Example: "MSDASQL"

      Yes
      ProviderTypePROVIDER_TYPEarrayarray [todo] not null

      The types of data supported by the @@ -1233,13 +1298,12 @@

      2.6.3.1. getDatasources
      implements the OLE DB for Data Mining specification.
      No
      AuthenticationModeAUTHENTICATION_MODEEnumStringEnumString [todo] not null Specification of what type of @@ -1255,7 +1319,6 @@
      2.6.3.1. getDatasources
      No
      @@ -1270,46 +1333,41 @@
      2.6.3.2. getDatabaseProperties
      - - + + - - + - - + - - + - - + - @@ -1320,22 +1378,19 @@
      2.6.3.2. getDatabaseProperties
      - - + -
      Column nameTypeColumn nameType DescriptionNullable
      PROPERTY_NAMEstringString not null The name of the property. No
      PROPERTY_DESCRIPTIONstringString A localizable text description of the property.Yes
      PROPERTY_TYPEstringString The XML data type of the property.Yes
      PROPERTY_ACCESS_TYPEEnumStringEnumString [todo] not null Access for the property. The value can be Read, Write, or ReadWrite.No
      True if a property is required, false if it is not required.Yes
      VALUEstringString The current value of the property.Yes

      [Is VALUE a JDBC reserved word? If so, change it.]

      -
      2.6.3.3 getLiterals

      Retrieves a list of information on supported literals, including data types and values.

      @@ -1344,23 +1399,19 @@
      2.6.3.3 getLiterals
      - - + + - - - - + + - - - - + + - - - - + - + - - - - + - + - - - - + - + - - -
      Column nameTypeColumn nameType DescriptionRestrictionNullable
      LiteralNamestringLITERAL_NAMEString not null

      The name of the literal described in the row.

      Example: DBLITERAL_LIKE_PERCENT

      Yes, as an arrayNo
      LiteralValuestringLITERAL_VALUEString

      Contains the actual literal value.

      Example, if LiteralName is @@ -1369,50 +1420,39 @@

      2.6.3.3 getLiterals
      "%".

      NoYes
      LiteralInvalidCharsLITERAL_INVALID_CHARSstringString

      The characters, in the literal, that are not valid.

      For example, if table names can contain anything other than a numeric character, this string would be "0123456789".

      NoYes
      LiteralInvalidStartingCharsLITERAL_INVALID_
      + STARTING_CHARS
      stringString The characters that are not valid as the first character of the literal. If the literal can start with any valid character, this is null.NoYes
      LiteralMaxLengthLITERAL_MAX_LENGTHintegerint The maximum number of characters in the literal. If there is no maximum or the maximum is unknown, the value is –1.NoYes
      @@ -1424,29 +1464,29 @@
      2.6.3.4. getCubes
      - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - +
      Column nameType indicatorColumn nameType Description
      CATALOG_NAMEDBTYPE_WSTRString The name of the database.
      SCHEMA_NAMEDBTYPE_WSTRString Not supported.
      CUBE_NAMEDBTYPE_WSTRString The name of the cube or dimension. Dimension names are prefaced by a dollar sign ($) symbol.
      CUBE_TYPEDBTYPE_WSTRString The type of the cube. Valid values are:
      • CUBE
      • DIMENSION
      • @@ -1455,76 +1495,76 @@
        2.6.3.4. getCubes
      CUBE_GUIDDBTYPE_GUIDString Not supported.
      CREATED_ONDBTYPE_DBTIMESTAMPTimestamp Not supported.
      LAST_SCHEMA_UPDATEDBTYPE_DBTIMESTAMPTimestamp The time that the cube was last processed.
      SCHEMA_UPDATED_BYDBTYPE_WSTRString Not supported.
      LAST_DATA_UPDATEDBTYPE_DBTIMESTAMPTimestamp The time that the cube was last processed.
      DATA_UPDATED_BYDBTYPE_WSTRString Not supported.
      DESCRIPTIONDBTYPE_WSTRString A user-friendly description of the cube.
      IS_DRILLTHROUGH_ENABLEDDBTYPE_BOOLboolean A Boolean that always returns true.
      IS_LINKABLEDBTYPE_BOOLboolean A Boolean that indicates whether a cube can be used in a linked cube.
      IS_WRITE_ENABLEDDBTYPE_BOOLboolean A Boolean that indicates whether a cube is write-enabled.
      IS_SQL_ENABLEDDBTYPE_BOOLboolean A Boolean that indicates whether SQL can be used on the cube.
      CUBE_CAPTIONDBTYPE_WSTRString The caption of the cube.
      BASE_CUBE_NAMEDBTYPE_WSTRString The name of the source cube if this cube is a perspective cube.
      ANNOTATIONSDBTYPE_WSTRString (Optional) A set of notes, in XML format.
      @@ -1540,28 +1580,28 @@
      2.6.3.5. getDimensions
      - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - +
      Column nameType indicatorColumn nameType Description
      CATALOG_NAMEDBTYPE_WSTRString The name of the database.
      SCHEMA_NAMEDBTYPE_WSTRString Not supported.
      CUBE_NAMEDBTYPE_WSTRString The name of the cube.
      DIMENSION_NAMEDBTYPE_WSTRString The name of the dimension. If a dimension is part of more than one cube or measure group, then there is one row for each unique combination of @@ -1569,29 +1609,29 @@
      2.6.3.5. getDimensions
      DIMENSION_UNIQUE_NAMEDBTYPE_WSTRString The unique name of the dimension.
      DIMENSION_GUIDDBTYPE_GUIDString Not supported.
      DIMENSION_CAPTIONDBTYPE_WSTRString The caption of the dimension. This should be used when displaying the name of the dimension to the user, such as in the user interface or reports.
      DIMENSION_ORDINALDBTYPE_UI4int The position of the dimension within the cube.
      DIMENSION_TYPEDBTYPE_I2int The type of the dimension. Valid values include:
      • MD_DIMTYPE_UNKNOWN (0)
      • MD_DIMTYPE_TIME (1)
      • @@ -1615,28 +1655,28 @@
        2.6.3.5. getDimensions
      DIMENSION_CARDINALITYDBTYPE_UI4int The number of members in the key attribute.
      DEFAULT_HIERARCHYDBTYPE_WSTRString A hierarchy from the dimension. Preserved for backwards compatibility.
      DESCRIPTIONDBTYPE_WSTRString A user-friendly description of the dimension.
      IS_VIRTUALDBTYPE_BOOLboolean Always FALSE.
      IS_READWRITEDBTYPE_BOOLboolean A Boolean that indicates whether the dimension is write-enabled. @@ -1645,7 +1685,7 @@
      2.6.3.5. getDimensions
      DIMENSION_UNIQUE_SETTINGSDBTYPE_I4int A bitmap that specifies which columns contain unique values if the dimension contains only members with unique names. The following bit value constants @@ -1656,13 +1696,14 @@
      2.6.3.5. getDimensions
      DIMENSION_MASTER_UNIQUE_NAMEDBTYPE_WSTRDIMENSION_MASTER_
      + UNIQUE_NAME
      String Always NULL.
      DIMENSION_IS_VISIBLEDBTYPE_BOOLboolean Always TRUE.
      @@ -1679,36 +1720,36 @@
      2.6.3.6. getFunctions
      - - + + - + - + - + - + - + - + - + - + - + - + - + - +
      Column nameType indicatorColumn nameType Description
      FUNCTION_NAMEDBTYPE_WSTRString The name of the function.
      DESCRIPTIONDBTYPE_WSTRString A description of the function.
      PARAMETER_LISTDBTYPE_WSTRString A comma delimited list of parameters formatted as in Microsoft Visual Basic. For example, a parameter might be Name as String.
      RETURN_TYPEDBTYPE_I4int The VARTYPE of the return data type of the function.
      ORIGINDBTYPE_I4int The origin of the function:
      • 1 for MDX functions.
      • 2 for user-defined functions.
      • @@ -1717,27 +1758,27 @@
        2.6.3.6. getFunctions
      INTERFACE_NAMEDBTYPE_WSTRString The name of the interface for user-defined functions

      The group name for Multidimensional Expressions (MDX) functions.

      LIBRARY_NAMEDBTYPE_WSTRString The name of the type library for user-defined functions. NULL for MDX functions.
      DLL_NAMEDBTYPE_WSTRString (Optional) The name of the assembly that implements the user-defined function.

      Returns VT_NULL for MDX functions.

      HELP_FILEDBTYPE_WSTRString (Optional) The name of the file that contains the help documentation for the user-defined function.

      Returns VT_NULL for MDX @@ -1745,13 +1786,13 @@

      2.6.3.6. getFunctions
      HELP_CONTEXTDBTYPE_I4int (Optional) Returns the Help context ID for this function.
      OBJECTDBTYPE_WSTRString (Optional) The generic name of the object class to which a property applies. For example, the rowset corresponding to the <level_name>.Members function @@ -1761,7 +1802,7 @@
      2.6.3.6. getFunctions
      CAPTIONDBTYPE_WSTRString The display caption for the function.
      @@ -1777,31 +1818,31 @@
      2.6.3.7. getHierarchies
      - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - +
      Column nameType indicatorColumn nameType Description
      CATALOG_NAMEDBTYPE_WSTRString The name of the catalog to which this hierarchy belongs. NULL if the provider does not support catalogs.
      SCHEMA_NAMEDBTYPE_WSTRString Not supported
      CUBE_NAMEDBTYPE_WSTRString (Required) The name of the cube to which this hierarchy belongs.
      DIMENSION_UNIQUE_NAMEDBTYPE_WSTRString The unique name of the dimension to which this hierarchy belongs. For providers that generate unique names by qualification, each component of @@ -1809,7 +1850,7 @@
      2.6.3.7. getHierarchies
      HIERARCHY_NAMEDBTYPE_WSTRString The name of the hierarchy. Blank if there is only a single hierarchy in the dimension. This will always have a value in Microsoft SQL Server 2005 @@ -1817,17 +1858,17 @@
      2.6.3.7. getHierarchies
      HIERARCHY_UNIQUE_NAMEDBTYPE_WSTRString The unique name of the hierarchy.
      HIERARCHY_GUIDDBTYPE_GUIDString Not supported
      HIERARCHY_CAPTIONDBTYPE_WSTRString A label or a caption associated with the hierarchy. Used primarily for display purposes. If a caption does not exist, HIERARCHY_NAME is @@ -1837,7 +1878,7 @@
      2.6.3.7. getHierarchies
      DIMENSION_TYPEDBTYPE_I2int [define enum] The type of the dimension. Valid values include the following values:
      • MD_DIMTYPE_UNKNOWN (0)
      • @@ -1862,30 +1903,30 @@
        2.6.3.7. getHierarchies
      HIERARCHY_CARDINALITYDBTYPE_UI4int The number of members in the hierarchy.
      DEFAULT_MEMBERDBTYPE_WSTRString The default member for this hierarchy. This is a unique name. Every hierarchy must have a default member.
      ALL_MEMBERDBTYPE_WSTRString The member at the highest level of the rollup.
      DESCRIPTIONDBTYPE_WSTRString A human-readable description of the hierarchy. NULL if no description exists.
      STRUCTUREDBTYPE_I2int The structure of the hierarchy. Valid values include the following values:
      • MD_STRUCTURE_FULLYBALANCED (0)
      • @@ -1897,12 +1938,12 @@
        2.6.3.7. getHierarchies
      IS_VIRTUALDBTYPE_BOOLboolean Always returns False.
      IS_READWRITEDBTYPE_BOOLboolean A Boolean that indicates whether the Write Back to dimension column is enabled.

      Returns TRUE if the Write Back to dimension column that @@ -1910,43 +1951,44 @@

      2.6.3.7. getHierarchies
      DIMENSION_UNIQUE_SETTINGSDBTYPE_I4int Always returns MDDIMENSIONS_MEMBER_KEY_UNIQUE (1).
      DIMENSION_MASTER_UNIQUE_NAMEDBTYPE_WSTRDIMENSION_MASTER_
      + UNIQUE_NAME
      String Always returns NULL.
      DIMENSION_IS_VISIBLEDBTYPE_BOOLboolean Always returns true. If the dimension is not visible, it will not appear in the schema rowset.
      HIERARCHY_ORDINALDBTYPE_UI4int The ordinal number of the hierarchy across all hierarchies of the cube.
      DIMENSION_IS_SHAREDDBTYPE_BOOLboolean Always returns TRUE.
      HIERARCHY_IS_VISIBLEDBTYPE_BOOLboolean A Boolean that indicates whether the hieararchy is visible.

      Returns TRUE if the hierarchy is visible; otherwise, FALSE.

      HIERARCHY_ORIGINDBTYPE_UI2int A bit mask that determines the source of the hierarchy:
      • MD_USER_DEFINED identifies user @@ -1964,7 +2006,7 @@
        2.6.3.7. getHierarchies
      HIERARCHY_DISPLAY_FOLDERDBTYPE_WSTRString The path to be used when displaying the hierarchy in the user interface. Folder names will be separated by a semicolon (;). Nested folders are @@ -1972,7 +2014,7 @@
      2.6.3.7. getHierarchies
      INSTANCE_SELECTIONDBTYPE_UI2int A hint to the client application on how to show the hierarchy. Valid values include the following values:
        @@ -1996,33 +2038,33 @@
        2.6.3.8. getLevels

        The returned result set contains the following columns.

        - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - + - +
        Column nameType indicatorColumn nameType Description
        CATALOG_NAMEDBTYPE_WSTRString The name of the catalog to which this level belongs. NULL if the provider does not support catalogs.
        SCHEMA_NAMEDBTYPE_WSTRString The name of the schema to which this level belongs. NULL if the provider does not support schemas.
        CUBE_NAMEDBTYPE_WSTRString The name of the cube to which this level belongs.
        DIMENSION_UNIQUE_NAMEDBTYPE_WSTRString The unique name of the dimension to which this level belongs. For providers that generate unique names by qualification, each component of this name @@ -2030,7 +2072,7 @@
        2.6.3.8. getLevels
        HIERARCHY_UNIQUE_NAMEDBTYPE_WSTRString The unique name of the hierarchy. If the level belongs to more than one hierarchy, there is one row for each hierarchy to which it belongs. For @@ -2040,22 +2082,22 @@
        2.6.3.8. getLevels
        LEVEL_NAMEDBTYPE_WSTRString The name of the level.
        LEVEL_UNIQUE_NAMEDBTYPE_WSTRString The properly escaped unique name of the level.
        LEVEL_GUIDDBTYPE_GUIDString Not supported.
        LEVEL_CAPTIONDBTYPE_WSTRString A label or caption associated with the hierarchy. Used primarily for display purposes. If a caption does not exist, LEVEL_NAME is @@ -2063,18 +2105,18 @@
        2.6.3.8. getLevels
        LEVEL_NUMBERDBTYPE_UI4int The distance of the level from the root of the hierarchy. Root level is zero (0).
        LEVEL_CARDINALITYDBTYPE_UI4int The number of members in the level.
        LEVEL_TYPEDBTYPE_I4int Type of the level:
        • MDLEVEL_TYPE_GEO_CONTINENT (0x2001)
        • MDLEVEL_TYPE_GEO_REGION (0x2002)
        • @@ -2107,13 +2149,13 @@
          2.6.3.8. getLevels
        DESCRIPTIONDBTYPE_WSTRString A human-readable description of the level. NULL if no description exists.
        CUSTOM_ROLLUP_SETTINGSDBTYPE_I4int A bitmap that specifies the custom rollup options:
        • MDLEVELS_CUSTOM_ROLLUP_EXPRESSION (0x01) @@ -2136,7 +2178,7 @@
          2.6.3.8. getLevels
        LEVEL_UNIQUE_SETTINGSDBTYPE_I4int A bitmap that specifies which columns contain unique values, if the level only has members with unique names or keys. The Msmd.h file defines the @@ -2152,7 +2194,7 @@
        2.6.3.8. getLevels
        LEVEL_IS_VISIBLEDBTYPE_BOOLboolean A Boolean that indicates whether the level is visible.

        Always returns True. If the level is not visible, it will not be included in the schema @@ -2160,55 +2202,60 @@

        2.6.3.8. getLevels
        LEVEL_ORDERING_PROPERTYDBTYPE_WSTRString The ID of the attribute that the level is sorted on.
        LEVEL_DBTYPEDBTYPE_I4int The DBTYPE enumeration of the member key column that is used for the level attribute.

        Null if concatenated keys are used as the member key column.

        LEVEL_MASTER_UNIQUE_NAMEDBTYPE_WSTRLEVEL_MASTER_
        + UNIQUE_NAME
        String Always returns NULL.
        LEVEL_NAME_SQL_COLUMN_NAMEDBTYPE_WSTRLEVEL_NAME_
        + SQL_COLUMN_NAME
        String The SQL representation of the level member names.
        LEVEL_KEY_SQL_COLUMN_NAMEDBTYPE_WSTRLEVEL_KEY_
        + SQL_COLUMN_NAME
        String The SQL representation of the level member key values.
        LEVEL_UNIQUE_NAME_SQL_COLUMN_NAMEDBTYPE_WSTRLEVEL_UNIQUE_NAME_
        + SQL_COLUMN_NAME
        String The SQL representation of the member unique names.
        LEVEL_ATTRIBUTE_HIERARCHY_NAMEDBTYPE_WSTRLEVEL_ATTRIBUTE_
        + HIERARCHY_NAME
        String The name of the attribute hierarchy providing the source of the level.
        LEVEL_KEY_CARDINALITYDBTYPE_UI2int The number of columns in the level key.
        LEVEL_ORIGINDBTYPE_UI2int A bit map that defines how the level was sourced:
        • MD_ORIGIN_USER_DEFINED identifies @@ -2234,66 +2281,57 @@
          2.6.3.9. getMeasures

          The returned result set contains the following columns.

          - - - + + - - + - - + - - + - - + - - + - - + - - + - - + - - + - - + - - + - - + - - + - - + - - + - - + - - - + + - - - + + - - + - - + - - +
          Column nameType indicatorLengthColumn nameType Description
          CATALOG_NAMEDBTYPE_WSTR String The name of the catalog to which this measure belongs. NULL if the provider does not support catalogs.
          SCHEMA_NAMEDBTYPE_WSTR String The name of the schema to which this measure belongs. NULL if the provider does not support schemas.
          CUBE_NAMEDBTYPE_WSTR String The name of the cube to which this measure belongs.
          MEASURE_NAMEDBTYPE_WSTR String The name of the measure.
          MEASURE_UNIQUE_NAMEDBTYPE_WSTR String The Unique name of the measure. For providers that generate unique names by qualification, each component of this name is delimited.
          MEASURE_CAPTIONDBTYPE_WSTR String A label or caption associated with the measure. Used primarily for display purposes. If a caption does not exist, MEASURE_NAME is returned.
          MEASURE_GUIDDBTYPE_GUID String Not supported.
          MEASURE_AGGREGATORDBTYPE_I4 int An enumeration that identifies how a measure was derived. Can be one of the following values:
          • MDMEASURE_AGGR_SUM (1)
          • @@ -2319,22 +2357,19 @@
            2.6.3.9. getMeasures
          DATA_TYPEDBTYPE_UI2 int The data type of the measure.
          NUMERIC_PRECISIONDBTYPE_UI2 int The maximum precision of the property if the measure object's data type is exact numeric. NULL for all other property types.
          NUMERIC_SCALEDBTYPE_I2 int The number of digits to the right of the decimal point if the measure object's type indicator is DBTYPE_NUMERIC or DBTYPE_DECIMAL. @@ -2342,62 +2377,55 @@
          2.6.3.9. getMeasures
          MEASURE_UNITSDBTYPE_WSTR String Not supported
          DESCRIPTIONDBTYPE_WSTR String A human-readable description of the measure. NULL if no description exists.
          EXPRESSIONDBTYPE_WSTR String An expression for the member.
          MEASURE_IS_VISIBLEDBTYPE_BOOL boolean A Boolean that always returns True. If the measure is not visible, it will not be included in the schema rowset.
          LEVELS_LISTDBTYPE_WSTR String A string that always returns NULL.
          MEASURE_NAME_SQL_COLUMN_NAMEDBTYPE_WSTR MEASURE_NAME_
          + SQL_COLUMN_NAME
          String The name of the column in the SQL query that corresponds to the measure's name.
          MEASURE_UNQUALIFIED_CAPTIONDBTYPE_WSTR MEASURE_UNQUALIFIED_
          + CAPTION
          String The name of the measure, not qualified with the measure group name.
          MEASUREGROUP_NAMEDBTYPE_WSTR String The name of the measure group to which the measure belongs.
          MEASURE_DISPLAY_FOLDERDBTYPE_WSTR String The path to be used when displaying the measure in the user interface. Folder names will be separated by a semicolon. Nested folders are @@ -2405,8 +2433,7 @@
          2.6.3.9. getMeasures
          DEFAULT_FORMAT_STRINGDBTYPE_WSTR String The default format string for the measure.
          @@ -2421,82 +2448,70 @@
          2.6.3.10. getMembers
          - - - + + - - + - - + - - + - - + - - + - - + - - + - - + - - + - - + - - + - - + - - + - - + - - + - - + - - + - - + - - + - - + - - + - - + - - +
          Column nameType indicatorLengthColumn nameType Description
          CATALOG_NAMEDBTYPE_WSTR String The name of the database to which this member belongs.
          SCHEMA_NAMEDBTYPE_WSTR String The name of the schema to which this member belongs.
          CUBE_NAMEDBTYPE_WSTR String The name of the cube to which this member belongs.
          DIMENSION_UNIQUE_NAMEDBTYPE_WSTR String The unique name of the dimension to which this member belongs.
          HIERARCHY_UNIQUE_NAMEDBTYPE_WSTR String The unique name of the hierarchy to which this member belongs.
          LEVEL_UNIQUE_NAMEDBTYPE_WSTR String The unique name of the level to which this member belongs.
          LEVEL_NUMBERDBTYPE_UI4 int The distance of the member from the root of the hierarchy. The root level is zero (0).
          MEMBER_ORDINALDBTYPE_UI4 int (Deprecated) Always returns 0.
          MEMBER_NAMEDBTYPE_WSTR String The name of the member.
          MEMBER_UNIQUE_NAMEDBTYPE_WSTR String The unique name of the member.
          MEMBER_TYPEDBTYPE_I4 int The type of the member:
          • MDMEMBER_TYPE_REGULAR (1)
          • @@ -2514,23 +2529,20 @@
            2.6.3.10. getMembers
          MEMBER_GUIDDBTYPE_GUID String The GUID of the member. NULL if no GUID exists.
          MEMBER_CAPTIONDBTYPE_WSTR String A label or caption associated with the member. Used primarily for display purposes. If a caption does not exist, MEMBER_NAME is returned.
          CHILDREN_CARDINALITYDBTYPE_UI4 int The number of children that the member has. This can be an estimate, so consumers should not rely on this to be the exact count. Providers should return @@ -2538,49 +2550,42 @@
          2.6.3.10. getMembers
          PARENT_LEVELDBTYPE_UI4 int The distance of the member's parent from the root level of the hierarchy. The root level is zero (0).
          PARENT_UNIQUE_NAMEDBTYPE_WSTR String The unique name of the member's parent. NULL is returned for any members at the root level.
          PARENT_COUNTDBTYPE_UI4 int The number of parents that this member has.
          DESCRIPTIONDBTYPE_WSTR String Always returns NULL.
          EXPRESSIONDBTYPE_WSTR String The expression for calculations, if the member is of type MDMEMBER_TYPE_FORMULA.
          MEMBER_KEYDBTYPE_WSTR String The value of the member's key column. Returns NULL if the member has a composite key.
          IS_PLACEHOLDERMEMBERDBTYPE_BOOL boolean A Boolean that indicates whether a member is a placeholder member for an empty position in a dimension hierarchy.

          It is valid only if the @@ -2589,8 +2594,7 @@

          2.6.3.10. getMembers
          IS_DATAMEMBERDBTYPE_BOOL boolean A Boolean that indicates whether the member is a data member. @@ -2599,8 +2603,7 @@
          2.6.3.10. getMembers
          Zero or more additional columnsDBTYPE_UI2 int No properties are returned if the members could be returned from multiple levels. For example, if the Tree operator is PARENT and SELF @@ -2628,44 +2631,44 @@
          2.6.3.11. getProperties
          - - + + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - - + + - + - + - +
          Column nameType indicatorColumn nameType Description
          CATALOG_NAMEDBTYPE_WSTRString The name of the database.
          SCHEMA_NAMEDBTYPE_WSTRString The name of the schema to which this property belongs. NULL if the provider does not support schemas.
          CUBE_NAMEDBTYPE_WSTRString The name of the cube.
          DIMENSION_UNIQUE_NAMEDBTYPE_WSTRString The unique name of the dimension. For providers that generate unique names by qualification, each component of this name is delimited.
          HIERARCHY_UNIQUE_NAMEDBTYPE_WSTRString The unique name of the hierarchy. For providers that generate unique names by qualification, each component of this name is delimited.
          LEVEL_UNIQUE_NAMEDBTYPE_WSTRString The unique name of the level to which this property belongs. If the provider does not support named levels, it should return the @@ -2676,7 +2679,7 @@
          2.6.3.11. getProperties
          MEMBER_UNIQUE_NAMEDBTYPE_WSTRString The unique name of the member to which the property belongs. Used for data stores that do not support named levels or have properties on a @@ -2688,7 +2691,7 @@
          2.6.3.11. getProperties
          PROPERTY_TYPEDBTYPE_I2int A bitmap that specifies the type of the property:
          • MDPROP_MEMBER (1) identifies a @@ -2709,26 +2712,27 @@
            2.6.3.11. getProperties
          PROPERTY_NAMEDBTYPE_WSTRString The name of the property. If the key for the property is the same as the name for the property, PROPERTY_NAME will be blank.
          PROPERTY_CAPTIONDBTYPE_WSTRString A label or caption associated with the property, used primarily for display purposes. Returns PROPERTY_NAME if a caption does not exist.
          DATA_TYPEDBTYPE_UI2int The data type of the property.
          CHARACTER_MAXIMUM_LENGTHDBTYPE_UI4CHARACTER_
          + MAXIMUM_LENGTH
          int The maximum possible length of the property, if it is a character, binary, or bit type. @@ -2738,7 +2742,7 @@
          2.6.3.11. getProperties
          CHARACTER_OCTET_LENGTHDBTYPE_UI4int The maximum possible length (in bytes) of the property, if it is a character or binary type. @@ -2748,7 +2752,7 @@
          2.6.3.11. getProperties
          NUMERIC_PRECISIONDBTYPE_UI2int The maximum precision of the property, if it is a numeric data type. @@ -2757,7 +2761,7 @@
          2.6.3.11. getProperties
          NUMERIC_SCALEDBTYPE_I2int The number of digits to the right of the decimal point, if it is a DBTYPE_NUMERIC or DBTYPE_DECIMAL type. @@ -2766,13 +2770,13 @@
          2.6.3.11. getProperties
          DESCRIPTIONDBTYPE_WSTRString A human readable description of the property. NULL if no description exists.
          PROPERTY_CONTENT_TYPEDBTYPE_I2int The type of the property. Can be one of the following enumerations:
          • MD_PROPTYPE_REGULAR (0x00)
          • @@ -2845,19 +2849,19 @@
            2.6.3.11. getProperties
          SQL_COLUMN_NAMEDBTYPE_WSTRString The name of the property used in SQL queries from the cube dimension or database dDimension.
          LANGUAGEDBTYPE_UI2int The translation expressed as an LCID. Only valid for property translations.
          PROPERTY_ORIGINDBTYPE_UI2int Identifies the type of hierarchy that the property applies to:
          • MD_USER_DEFINED (1) indicates @@ -2872,14 +2876,15 @@
            2.6.3.11. getProperties
          PROPERTY_ATTRIBUTE_HIERARCHY_NAMEDBTYPE_WSTRPROPERTY_ATTRIBUTE_
          + HIERARCHY_NAME
          String The name of the attribute hierarchy sourcing this property.
          PROPERTY_CARDINALITYDBTYPE_WSTRString The cardinality of the property. Possible values include the following strings:
          MIME_TYPEDBTYPE_WSTRString The mime type for binary large objects (BLOBs).
          PROPERTY_IS_VISIBLEDBTYPE_BOOLboolean A Boolean that indicates whether the property is visible. @@ -2913,34 +2918,34 @@
          2.6.3.12. getSets
          - - + + - + - + - + - + - + - + - + - + - + - + - - + + + + + +
          Column nameType indicatorColumn nameType Description
          CATALOG_NAMEDBTYPE_WSTRString The name of the database.
          SCHEMA_NAMEDBTYPE_WSTRString Not supported.
          CUBE_NAMEDBTYPE_WSTRString The name of the cube.
          SET_NAMEDBTYPE_WSTRString The name of the set, as specified in the CREATE SET statement.
          SCOPEDBTYPE_I4int The scope of the set:
          • MDSET_SCOPE_GLOBAL (1)
          • MDSET_SCOPE_SESSION (2)
          • @@ -2949,30 +2954,30 @@
            2.6.3.12. getSets
          DESCRIPTIONDBTYPE_WSTRString Not supported.
          EXPRESSIONDBTYPE_WSTRString The expression for the set.
          DIMENSIONSDBTYPE_WSTRString A comma delimited list of hierarchies included in the set.
          SET_CAPTIONDBTYPE_WSTRString A label or caption associated with the set. The label or caption is used primarily for display purposes.
          SET_DISPLAY_FOLDERDBTYPE_WSTRString The path to be used by the user interface when displaying the set. Folder names are separated by a backslash (\), folders are separated by a @@ -2991,8 +2996,15 @@

          2.6.4. Other methods

          Description
          getMdxKeywords()Returns + getDatabase()Returns the one and only Database.
          + getMdxKeywords()Returns the keywords of this dialect of MDX, as a comma-separated + string.
          diff --git a/lib/spring.jar b/lib/spring.jar new file mode 100755 index 0000000..e6b517d Binary files /dev/null and b/lib/spring.jar differ diff --git a/src/org/olap4j/OlapConnection.java b/src/org/olap4j/OlapConnection.java index 1a29a41..c4e37e3 100644 --- a/src/org/olap4j/OlapConnection.java +++ b/src/org/olap4j/OlapConnection.java @@ -10,10 +10,9 @@ package org.olap4j; import org.olap4j.mdx.parser.MdxParserFactory; +import org.olap4j.metadata.Schema; import java.sql.Connection; -import java.sql.SQLException; -import java.sql.Statement; /** * Connection to an OLAP server. @@ -24,21 +23,27 @@ */ public interface OlapConnection extends Connection { + // overrides Connection, with refined return type and throws list + OlapDatabaseMetaData getMetaData() throws OlapException; + /** * Creates a prepared OLAP Statement. */ - PreparedOlapStatement prepareOlapStatement(String mdx) throws SQLException; + PreparedOlapStatement prepareOlapStatement(String mdx) throws OlapException; /** * Returns the factory used to create MDX parsers in this connection. */ MdxParserFactory getParserFactory(); + // overrides Connection, with refined return type and throws list + OlapStatement createStatement() throws OlapException; + /** - * Override {@link java.sql.Connection#createStatement()} with refined - * result type. + * Returns the current {@link org.olap4j.metadata.Schema} of this + * connection. */ - OlapStatement createStatement() throws SQLException; + Schema getSchema() throws OlapException; } // End OlapConnection.java diff --git a/src/org/olap4j/OlapDatabaseMetaData.java b/src/org/olap4j/OlapDatabaseMetaData.java index d7c7340..a22af8c 100644 --- a/src/org/olap4j/OlapDatabaseMetaData.java +++ b/src/org/olap4j/OlapDatabaseMetaData.java @@ -13,7 +13,6 @@ import java.sql.DatabaseMetaData; import java.sql.ResultSet; -import java.sql.SQLException; /** * Information about an OLAP database. @@ -44,7 +43,7 @@ public interface OlapDatabaseMetaData extends DatabaseMetaData { * *

          todo: document parameters and result set columns */ - ResultSet getActions() throws SQLException; + ResultSet getActions() throws OlapException; /** * Retrives a list of olap4j data sources that are available on the server. @@ -54,7 +53,7 @@ public interface OlapDatabaseMetaData extends DatabaseMetaData { *

          todo: document parameters and result set columns */ ResultSet getDatasources( - String dataSourceName) throws SQLException; + String dataSourceName) throws OlapException; /** * Retrieves a list of information on supported literals, including data @@ -64,7 +63,7 @@ ResultSet getDatasources( * *

          todo: document parameters and result set columns */ - ResultSet getLiterals() throws SQLException; + ResultSet getLiterals() throws OlapException; /** * Retrieves a list of the standard and provider-specific properties @@ -78,7 +77,7 @@ ResultSet getDatasources( *

          todo: document parameters and result set columns */ ResultSet getDatabaseProperties( - String dataSourceName) throws SQLException; + String dataSourceName) throws OlapException; /** * Retrieves a list of descriptions of member and cell Properties. @@ -89,15 +88,15 @@ ResultSet getDatabaseProperties( * *

          todo: document parameters and result set columns */ - ResultSet getProperties() throws SQLException; + ResultSet getProperties() throws OlapException; /** * Retrieves a comma-separated list of all of this database's MDX keywords. * * @return the list of this database's MDX keywords - * @exception java.sql.SQLException if a database access error occurs + * @exception OlapException if a database access error occurs */ - String getMdxKeywords() throws SQLException; + String getMdxKeywords() throws OlapException; /** * Retrieves a description of a cube. @@ -117,7 +116,7 @@ ResultSet getDatabaseProperties( public ResultSet getCubes( String catalog, String schemaPattern, - String cubeNamePattern) throws SQLException; + String cubeNamePattern) throws OlapException; /** * Retrieves a result set describing the shared and private dimensions * within a database. @@ -126,7 +125,7 @@ public ResultSet getCubes( * *

          todo: document parameters and result set columns */ - ResultSet getDimensions() throws SQLException; + ResultSet getDimensions() throws OlapException; /** * Retrieves a result set describing the functions available to client @@ -136,7 +135,7 @@ public ResultSet getCubes( * *

          todo: document parameters and result set columns */ - ResultSet getFunctions() throws SQLException; + ResultSet getFunctions() throws OlapException; /** * Retrieves a result set describing each hierarchy within a particular @@ -146,7 +145,7 @@ public ResultSet getCubes( * *

          todo: document parameters and result set columns */ - ResultSet getHierarchies() throws SQLException; + ResultSet getHierarchies() throws OlapException; /** * Retrieves a result set describing each measure within a cube. @@ -155,7 +154,7 @@ public ResultSet getCubes( * *

          todo: document parameters and result set columns */ - ResultSet getMeasures() throws SQLException; + ResultSet getMeasures() throws OlapException; /** * Retrieves a result set describing the members within a database. @@ -164,7 +163,7 @@ public ResultSet getCubes( * *

          todo: document parameters and result set columns */ - ResultSet getMembers() throws SQLException; + ResultSet getMembers() throws OlapException; /** * Retrieves a result set describing each level within a particular @@ -174,7 +173,7 @@ public ResultSet getCubes( * *

          todo: document parameters and result set columns */ - ResultSet getLevels() throws SQLException; + ResultSet getLevels() throws OlapException; /** * Retrieves a result set describing each calculated set. @@ -183,7 +182,7 @@ public ResultSet getCubes( * *

          todo: document parameters and result set columns */ - ResultSet getSets() throws SQLException; + ResultSet getSets() throws OlapException; } // End OlapDatabaseMetaData.java diff --git a/src/org/olap4j/OlapParameterMetaData.java b/src/org/olap4j/OlapParameterMetaData.java index 6e24b6a..fd210b7 100755 --- a/src/org/olap4j/OlapParameterMetaData.java +++ b/src/org/olap4j/OlapParameterMetaData.java @@ -12,7 +12,6 @@ import org.olap4j.type.Type; import java.sql.ParameterMetaData; -import java.sql.SQLException; /** * Extension to {@link ParameterMetaData} for parameters of OLAP statements. @@ -44,9 +43,9 @@ public interface OlapParameterMetaData extends ParameterMetaData { * * @param param the first parameter is 1, the second is 2, ... * @return OLAP type - * @exception SQLException if a database access error occurs + * @exception OlapException if a database access error occurs */ - Type getOlapType(int param) throws SQLException; + Type getOlapType(int param) throws OlapException; } // End OlapParameterMetaData.java diff --git a/src/org/olap4j/OlapResultSet.java b/src/org/olap4j/OlapResultSet.java index 8effae4..3884744 100644 --- a/src/org/olap4j/OlapResultSet.java +++ b/src/org/olap4j/OlapResultSet.java @@ -9,13 +9,8 @@ */ package org.olap4j; -import org.olap4j.metadata.Property; -import org.olap4j.metadata.Cube; - import java.util.List; import java.sql.ResultSet; -import java.sql.ResultSetMetaData; -import java.sql.SQLException; /** * Result of executing an OLAP Statement. diff --git a/src/org/olap4j/OlapStatement.java b/src/org/olap4j/OlapStatement.java index a49f0f4..bc732b4 100644 --- a/src/org/olap4j/OlapStatement.java +++ b/src/org/olap4j/OlapStatement.java @@ -9,12 +9,9 @@ */ package org.olap4j; -import org.olap4j.metadata.Cube; +import mondrian.olap.Query; import java.sql.Statement; -import java.sql.SQLException; - -import mondrian.olap.Query; /** * Object used for statically executing an MDX statement and returning an @@ -31,7 +28,7 @@ public interface OlapStatement extends Statement { /** * Executes an OLAP statement. */ - OlapResultSet executeOlapQuery(String mdx) throws SQLException; + OlapResultSet executeOlapQuery(String mdx) throws OlapException; /** * Executes an OLAP statement expressed as a parse tree. diff --git a/src/org/olap4j/PreparedOlapStatement.java b/src/org/olap4j/PreparedOlapStatement.java index 9727ac4..4c7f2e3 100644 --- a/src/org/olap4j/PreparedOlapStatement.java +++ b/src/org/olap4j/PreparedOlapStatement.java @@ -12,25 +12,24 @@ import org.olap4j.metadata.Cube; import java.sql.PreparedStatement; -import java.sql.SQLException; /** * An object that represents a precompiled OLAP statement. * - *

          An OLAP statement is precompiled and stored in a + *

          An OLAP statement is precompiled and stored in a * PreparedOlapStatement object. This object can then be used to - * efficiently execute this statement multiple times. + * efficiently execute this statement multiple times.

          * - *

          Note: The setter methods (setShort, + *

          Note: The setter methods (setShort, * setString, and so on) for setting IN parameter values * must specify types that are compatible with the defined type of * the input parameter. For instance, if the IN parameter has type - * INTEGER, then the method setInt should be used. + * INTEGER, then the method setInt should be used.

          * *

          If a parameter has Member type, use the {@link #setObject(int, Object)} - * method to set it. A {@link SQLException} will be thrown if the object is not + * method to set it. A {@link OlapException} will be thrown if the object is not * an instance of {@link org.olap4j.metadata.Member} or does not belong to the - * correct {@link org.olap4j.metadata.Hierarchy}. + * correct {@link org.olap4j.metadata.Hierarchy}.

          * *

          The method {@link #getParameterMetaData()} returns a description of the * parameters, as in JDBC. The result is an {@link OlapParameterMetaData}. @@ -55,9 +54,9 @@ public interface PreparedOlapStatement * * @return an OlapResultSet object that contains the data produced * by the query; never null - * @exception SQLException if a database access error occurs + * @exception OlapException if a database access error occurs */ - OlapResultSet executeQuery() throws SQLException; + OlapResultSet executeQuery() throws OlapException; /** * Retrieves the number, types and properties of this @@ -66,10 +65,10 @@ public interface PreparedOlapStatement * @return an OlapParameterMetaData object that contains * information about the number, types and properties of this * PreparedOlapStatement object's parameters - * @exception SQLException if a database access error occurs + * @exception OlapException if a database access error occurs * @see OlapParameterMetaData */ - OlapParameterMetaData getParameterMetaData() throws SQLException; + OlapParameterMetaData getParameterMetaData() throws OlapException; /** * Returns the cube (or virtual cube) which this statement is based upon. diff --git a/src/org/olap4j/metadata/Cube.java b/src/org/olap4j/metadata/Cube.java index 6d808f7..5259580 100644 --- a/src/org/olap4j/metadata/Cube.java +++ b/src/org/olap4j/metadata/Cube.java @@ -40,6 +40,13 @@ public interface Cube extends MetadataElement { */ List getMeasures(); + /** + * Returns a list of {@link NamedSet} objects in this Cube. + * + * @see org.olap4j.OlapDatabaseMetaData#getSets() + */ + NamedList getSets(); + /** * Returns a collection of {@link java.util.Locale} objects for which this * Cube has been localized. diff --git a/src/org/olap4j/metadata/Database.java b/src/org/olap4j/metadata/Database.java index e67a120..86a86b3 100644 --- a/src/org/olap4j/metadata/Database.java +++ b/src/org/olap4j/metadata/Database.java @@ -9,8 +9,47 @@ */ package org.olap4j.metadata; +import org.olap4j.OlapDatabaseMetaData; + /** - * Database ... + * + * A Database is the root object in the hierarchy of metadata + * objects: + *

          + *
            + *
          • {@link Database}
              + *
            • {@link Catalog}
                + *
              • {@link Schema}
                  + *
                • {@link Cube}
                    + *
                  • {@link Dimension}
                      + *
                    • {@link Hierarchy}
                        + *
                      • {@link Level}
                          + *
                        • {@link Member}
                        • + *
                        • {@link Property}
                        • + *
                      • + *
                    • + *
                  • + *
                  • {@link NamedSet}
                  • + *
                • + *
                • Dimension (shared)
                • + *
              • + *
            • + *
            + *
          + * + *

          A Database is usually accessed from a connection via its + * metadata: + *

          + * OlapConnection connection;
          + * Database database = connection.getMetaData().getDatabase(); + *
          + * + * or from a schema: + * + *
          + * OlapConnection connection;
          + * Database database = connection.getSchema().getCatalog().getDatabase(); + *
          * * @author jhyde * @version $Id: $ @@ -25,6 +64,11 @@ public interface Database { * @return List of Catalogs in this Database */ NamedList getCatalogs(); + + /** + * Retrieves the metadata describing this Database. + */ + OlapDatabaseMetaData getMetaData(); } // End Database.java diff --git a/src/org/olap4j/metadata/Hierarchy.java b/src/org/olap4j/metadata/Hierarchy.java index 873065f..f766686 100644 --- a/src/org/olap4j/metadata/Hierarchy.java +++ b/src/org/olap4j/metadata/Hierarchy.java @@ -18,24 +18,20 @@ */ public interface Hierarchy extends MetadataElement { /** - * Returns the {@link Dimension} this Hierarchy belongs to. + * Returns the {@link Dimension} this Hierarchy belongs to. */ Dimension getDimension(); /** - * Returns the name of this Hierarchy. - */ - String getName(); - - /** - * Returns a list of the {@link Level}s in this Hierarchy. + * Returns a list of the {@link Level} objects in this + * Hierarchy. * * @see org.olap4j.OlapDatabaseMetaData#getLevels */ NamedList getLevels(); /** - * Returns whether this Hierarchy has an 'all' member. + * Returns whether this Hierarchy has an 'all' member. */ boolean hasAll(); } diff --git a/src/org/olap4j/metadata/Level.java b/src/org/olap4j/metadata/Level.java index c86172c..7e29d73 100644 --- a/src/org/olap4j/metadata/Level.java +++ b/src/org/olap4j/metadata/Level.java @@ -19,7 +19,7 @@ */ public interface Level extends MetadataElement { /** - * Returns the depth of this level. + * Returns the depth of this Level. * *

          Note #1: In an access-controlled context, the first visible level of * a hierarchy may not have a depth of 0.

          @@ -30,24 +30,24 @@ public interface Level extends MetadataElement { int getDepth(); /** - * Returns the Hierarchy this Level belongs to. + * Returns the {@link Hierarchy} this Level belongs to. */ Hierarchy getHierarchy(); /** - * Returns the Dimension this Level belongs to. + * Returns the Dimension this Level belongs to. * (Always equivalent to getHierarchy().getDimension().) */ Dimension getDimension(); /** - * Returns the type of this Level. + * Returns the type of this Level. */ Level.Type getLevelType(); /** * Returns a list of definitions for the properties available to members - * of this Level. + * of this Level. * * @see org.olap4j.OlapDatabaseMetaData#getProperties() */ diff --git a/src/org/olap4j/metadata/Member.java b/src/org/olap4j/metadata/Member.java index 69a8d0f..f324687 100644 --- a/src/org/olap4j/metadata/Member.java +++ b/src/org/olap4j/metadata/Member.java @@ -12,9 +12,10 @@ import mondrian.olap.Exp; import mondrian.olap.Property; -import java.sql.SQLException; import java.util.List; +import org.olap4j.OlapException; + /** * Member is a data value in an OLAP Dimension. * @@ -153,10 +154,10 @@ private Type(int ordinal) { * * @param name Property name * @param value Property value - * @throws java.sql.SQLException if the value not valid for this property + * @throws OlapException if the value not valid for this property * (for example, a String value assigned to a Boolean property) */ - void setProperty(String name, Object value) throws SQLException; + void setProperty(String name, Object value) throws OlapException; /** * Returns the definitions of the properties this member may have. diff --git a/src/org/olap4j/metadata/NamedSet.java b/src/org/olap4j/metadata/NamedSet.java new file mode 100644 index 0000000..c5b3f83 --- /dev/null +++ b/src/org/olap4j/metadata/NamedSet.java @@ -0,0 +1,26 @@ +/* +// $Id: $ +// This software is subject to the terms of the Common Public License +// Agreement, available at the following URL: +// http://www.opensource.org/licenses/cpl.html. +// Copyright (C) 2006-2006 Julian Hyde +// All Rights Reserved. +// You must accept the terms of that agreement to use this software. +*/ +package org.olap4j.metadata; + +/** + * Metadata object describing a named set defined against a {@link Cube}. + * + * @author jhyde + * @version $Id: $ + * @since Oct 24, 2006 + */ +public interface NamedSet extends MetadataElement { + /** + * Returns the Cube that this NamedSet belongs to. + */ + Cube getCube(); +} + +// End NamedSet.java diff --git a/src/org/olap4j/metadata/Property.java b/src/org/olap4j/metadata/Property.java index ed99def..1b35289 100644 --- a/src/org/olap4j/metadata/Property.java +++ b/src/org/olap4j/metadata/Property.java @@ -14,7 +14,8 @@ import java.util.Locale; /** - * Definition of a property of a Member or Cell. + * Definition of a property of a {@link Member} or + * {@link org.olap4j.ResultCell}. * * @author jhyde * @version $Id$ diff --git a/src/org/olap4j/sample/SimpleQuerySample.java b/src/org/olap4j/sample/SimpleQuerySample.java index 547c086..319e7db 100644 --- a/src/org/olap4j/sample/SimpleQuerySample.java +++ b/src/org/olap4j/sample/SimpleQuerySample.java @@ -9,18 +9,21 @@ */ package org.olap4j.sample; +import mondrian.olap.Query; + import org.olap4j.*; -import org.olap4j.type.MemberType; import org.olap4j.mdx.parser.MdxParser; import org.olap4j.mdx.parser.MdxParserFactory; -import org.olap4j.metadata.Member; import org.olap4j.metadata.Dimension; +import org.olap4j.metadata.Member; +import org.olap4j.type.MemberType; -import java.sql.*; -import java.util.List; +import java.sql.DriverManager; +import java.sql.PreparedStatement; +import java.sql.SQLException; +import java.sql.Statement; import java.util.ArrayList; - -import mondrian.olap.Query; +import java.util.List; /** * Collection of olap4j samples illustrating connections and statements. @@ -33,6 +36,8 @@ public class SimpleQuerySample { public static void main(String[] args) { try { new SimpleQuerySample().simpleStatement(); + } catch (OlapException e) { + e.printStackTrace(); } catch (SQLException e) { e.printStackTrace(); } catch (ClassNotFoundException e) { @@ -44,7 +49,9 @@ public static void main(String[] args) { * Simple example which connects to an OLAP server, executes an OLAP * statement and prints the result. */ - void simpleStatement() throws SQLException, ClassNotFoundException { + void simpleStatement() + throws OlapException, SQLException, ClassNotFoundException + { // Register driver. Class.forName("mondrian.olap4j.Driver"); diff --git a/src/org/olap4j/sample/SpringSample.java b/src/org/olap4j/sample/SpringSample.java index 56c6c9a..0550f22 100644 --- a/src/org/olap4j/sample/SpringSample.java +++ b/src/org/olap4j/sample/SpringSample.java @@ -11,12 +11,10 @@ import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.jdbc.core.ResultSetExtractor; -import org.springframework.dao.DataAccessException; import org.olap4j.OlapResultSet; import javax.sql.DataSource; import java.sql.ResultSet; -import java.sql.SQLException; /** * Example of olap4j code running inside Spring framework. @@ -41,7 +39,6 @@ public static void example(DataSource dataSource) { "from [Sales]", new ResultSetExtractor() { public Object extractData(ResultSet resultSet) - throws SQLException, DataAccessException { OlapResultSet olapResult = (OlapResultSet) resultSet; return "Result has " +