Skip to content

Commit

Permalink
First round (and hopefully last) of olap4j 0.9.9.
Browse files Browse the repository at this point in the history
git-svn-id: https://olap4j.svn.sourceforge.net/svnroot/olap4j/trunk@383 c6a108a4-781c-0410-a6c6-c2d559e19af0
  • Loading branch information
lucboudreau committed Dec 20, 2010
1 parent 3bbe4b1 commit 3c125ae
Show file tree
Hide file tree
Showing 10 changed files with 377 additions and 136 deletions.
54 changes: 49 additions & 5 deletions src/org/olap4j/OlapConnection.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,23 @@ public interface OlapConnection extends Connection, OlapWrapper {
OlapStatement createStatement() throws OlapException;

/**
* Returns the current {@link org.olap4j.metadata.Schema} of this
* connection.
* Returns the database name that was selected for this connection,
* either through the JDBC URL or via
* {@link OlapConnection#setDatabase(String)}.
*
* @return current Schema
* @throws OlapException if database error occurs
* @return The name of the database that was selected for this connection.
* @throws OlapException If a server error occurs.
*/
Schema getSchema() throws OlapException;
String getDatabase() throws OlapException;

/**
* Sets the name of the database that will be used for this connection.
* Overrides the value passed, if any, through the JDBC URL.
*
* @param databaseName The name of the database to use.
* @throws OlapException If a server error occurs.
*/
void setDatabase(String databaseName) throws OlapException;

/**
* Returns a list of {@link org.olap4j.metadata.Catalog} objects which
Expand All @@ -76,9 +86,43 @@ public interface OlapConnection extends Connection, OlapWrapper {
*
* @see OlapDatabaseMetaData#getCatalogs()
* @return List of Catalogs in this connection's OLAP server
* @deprecated Deprecated in favor of
* {@link OlapDatabaseMetaData#getOlapCatalogs()}. Will be removed as
* of version 1.0.
*/
@Deprecated
NamedList<Catalog> getCatalogs();

/**
* Returns the {@link Catalog} name that was selected for this connection,
* either through the JDBC URL or via
* {@link OlapConnection#setCatalog(String)}.
*
* @return The name of the catalog that was selected for this connection.
* @throws OlapException If a server error occurs.
*/
String getCatalog() throws OlapException;

/**
* Sets the name of the catalog that will be used for this connection.
* Overrides the value passed, if any, through the JDBC URL.
*
* @param catalogName The name of the catalog to use for this connection.
* @throws OlapException If a server error occurs.
*/
void setCatalog(String catalogName) throws OlapException;

/**
* Returns the current active {@link org.olap4j.metadata.Schema}
* of this connection.
* @return The currently active schema, or null of none are
* currently selected.
* @throws OlapException if database error occurs
* @deprecated Will be removed as of version 1.0.
*/
@Deprecated
Schema getSchema() throws OlapException;

/**
* Sets the current locale of this connection. The value must not be null.
*
Expand Down
136 changes: 130 additions & 6 deletions src/org/olap4j/OlapDatabaseMetaData.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,9 @@
*/
package org.olap4j;

import org.olap4j.metadata.Member;
import org.olap4j.metadata.*;

import java.sql.DatabaseMetaData;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.*;
import java.util.Set;

/**
Expand Down Expand Up @@ -105,7 +103,7 @@ ResultSet getActions(
String actionNamePattern) throws OlapException;

/**
* Retrives a list of olap4j data sources that are available on the server.
* Retrieves a list of olap4j data sources that are available on the server.
*
* <p>Specification as for XML/A DISCOVER_DATASOURCES schema rowset. The
* rows are ordered by <code>DATA_SOURCE_NAME</code>.
Expand Down Expand Up @@ -146,11 +144,137 @@ ResultSet getActions(
*
* @return a <code>ResultSet</code> object in which each row is a
* datasource description
*
* @exception OlapException if a database access error occurs
* @deprecated Deprecated in favor of
* {@link OlapDatabaseMetaData#getDatabases()}. Will be removed
* in version 1.0.
*/
@Deprecated
ResultSet getDatasources() throws OlapException;

/**
* Retrieves a row set describing the databases that are available on the
* server.
*
* <p>Specification as for XML/A DISCOVER_DATASOURCES schema rowset.
*
* <ol>
* <li><b>DATA_SOURCE_NAME</b> String => The name of the data source, such
* as FoodMart 2000.</li>
* <li><b>DATA_SOURCE_DESCRIPTION</b> String => A description of the data
* source, as entered by the publisher. (may be
* <code>null</code>)</li>
* <li><b>URL</b> String => The unique path that shows where to invoke the
* XML for Analysis methods for that data source. (may be
* <code>null</code>)</li>
* <li><b>DATA_SOURCE_INFO</b> String => 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.<br/>Example: "Provider=MSOLAP;Data
* Source=Local;" (may be <code>null</code>)</li>
* <li><b>PROVIDER_NAME</b> String => The name of the provider behind the
* data source. <br/>Example: "MSDASQL" (may be
* <code>null</code>)</li>
* <li><b>PROVIDER_TYPE</b> EnumerationArray => The types of data supported
* by the provider. May include one or more of the following
* types. Example follows this table.<br/>TDP: tabular data
* provider.<br/>MDP: multidimensional data provider.<br/>DMP:
* data mining provider. A DMP provider implements the OLE DB for
* Data Mining specification.</li>
* <li><b>AUTHENTICATION_MODE</b> EnumString => Specification of what type
* of security mode the data source uses. Values can be one of
* the following:<br/>Unauthenticated: no user ID or password
* needs to be sent.<br/>Authenticated: User ID and Password must
* be included in the information required for the
* connection.<br/>Integrated: the data source uses the
* underlying security to determine authorization, such as
* Integrated Security provided by Microsoft Internet Information
* Services (IIS).</li>
* </ol>
*
* @return a <code>ResultSet</code> object in which each row is an
* OLAP database description
* @throws OlapException if a database access error occurs
*/
ResultSet getDatabases() throws OlapException;

/**
* Retrieves a list of olap4j catalogs that are available on the server.
*
* <p>Specification as for XML/A DBSCHEMA_CATALOGS schema rowset.
*
* <p>
* The list of returned catalogs is dependent on the underlying connection
* Database parameter. To discover catalogs in another database, use
* {@link OlapDatabaseMetaData#getDatabases()} and
* {@link OlapConnection#setDatabase(String)}
*
* <ol>
* <li><b>CATALOG_NAME</b> String => The catalog name, such as
* FoodMart.</li>
*
* <li><b>DESCRIPTION</b> String => A description of the
* catalog, as entered by the publisher. (may be
* <code>null</code>)</li></ol>
*
* <li><b>ROLES</b> String => A comma separated list of role names
* that users can impersonate. (may be
* <code>null</code>)</li></ol>
*
* <li><b>DATE_MODIFIED</b> String => The date of the latest modifications
* to the catalog. (may be <code>null</code>)</li></ol>
*
* @return a <code>ResultSet</code> object in which each row is an
* OLAP catalog description
* @throws OlapException if a database access error occurs
*/
ResultSet getCatalogs() throws OlapException;

/**
* Returns a list of {@link org.olap4j.metadata.Catalog} objects which
* belong to this connection's OLAP server.
*
* <p>
* The list of returned catalogs is dependent on the underlying connection
* Database parameter. To discover catalogs in another database, use
* {@link OlapDatabaseMetaData#getDatabases()} and
* {@link OlapConnection#setDatabase(String)}
*
* <p>The caller should assume that the list is immutable;
* if the caller modifies the list, behavior is undefined.</p>
*
* @return List of Catalogs in this connection's OLAP server
* @throws OlapException if a database access error occurs
*/
NamedList<Catalog> getOlapCatalogs() throws OlapException;

/**
* Retrieves a list of olap4j schemas that are available on the server.
*
* <p>Specification as for XML/A DBSCHEMA_SCHEMATA schema rowset.
*
* <p>
* The list of returned catalogs is dependent on the underlying connection
* Database parameter. To discover schemas in another database, use
* {@link OlapDatabaseMetaData#getDatabases()} and
* {@link OlapConnection#setDatabase(String)}
*
* <ol>
* <li><b>CATALOG_NAME</b> String => The name of the parent catalog to which
* the schema belongs to.</li>
*
* <li><b>SCHEMA_NAME</b> String => The name of the schema.</li>
*
* <li><b>SCHEMA_OWNER</b> String => The name of the user who is the owner
* of the schema (may be <code>null</code>)</li>
* </ol>
*
* @return a <code>ResultSet</code> object in which each row is an OLAP
* schema description
* @throws OlapException if a database access error occurs
*/
ResultSet getSchemas() throws OlapException;

/**
* Retrieves a list of information on supported literals, including data
* types and values.
Expand Down
Loading

0 comments on commit 3c125ae

Please sign in to comment.