org.olap4j
Interface OlapConnection

All Superinterfaces:
java.sql.Connection, OlapWrapper, java.sql.Wrapper

public interface OlapConnection
extends java.sql.Connection, OlapWrapper

Connection to an OLAP server.

Since:
Aug 22, 2006
Version:
$Id: OlapConnection.java 282 2009-10-01 00:57:29Z jhyde $
Author:
jhyde

Field Summary
 
Fields inherited from interface java.sql.Connection
TRANSACTION_NONE, TRANSACTION_READ_COMMITTED, TRANSACTION_READ_UNCOMMITTED, TRANSACTION_REPEATABLE_READ, TRANSACTION_SERIALIZABLE
 
Method Summary
 Scenario createScenario()
          Creates a Scenario.
 OlapStatement createStatement()
          
 NamedList<Catalog> getCatalogs()
          Returns a list of Catalog objects which belong to this connection's OLAP server.
 java.util.Locale getLocale()
          Returns this connection's locale.
 OlapDatabaseMetaData getMetaData()
          
 MdxParserFactory getParserFactory()
          Returns the factory used to create MDX parsers in this connection.
 java.lang.String getRoleName()
          Returns the name of the role in which this connection executes queries.
 Scenario getScenario()
          Returns this connection's active Scenario, or null if there is no active Scenario.
 Schema getSchema()
          Returns the current Schema of this connection.
 PreparedOlapStatement prepareOlapStatement(java.lang.String mdx)
          Creates a prepared OLAP Statement.
 void setLocale(java.util.Locale locale)
          Sets the current locale of this connection.
 void setRoleName(java.lang.String roleName)
          Sets the name of the role in which this connection executes queries.
 void setScenario(Scenario scenario)
          Sets the active Scenario of this connection.
 
Methods inherited from interface java.sql.Connection
clearWarnings, close, commit, createArrayOf, createBlob, createClob, createNClob, createSQLXML, createStatement, createStatement, createStruct, getAutoCommit, getCatalog, getClientInfo, getClientInfo, getHoldability, getTransactionIsolation, getTypeMap, getWarnings, isClosed, isReadOnly, isValid, nativeSQL, prepareCall, prepareCall, prepareCall, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, releaseSavepoint, rollback, rollback, setAutoCommit, setCatalog, setClientInfo, setClientInfo, setHoldability, setReadOnly, setSavepoint, setSavepoint, setTransactionIsolation, setTypeMap
 
Methods inherited from interface java.sql.Wrapper
isWrapperFor, unwrap
 
Methods inherited from interface org.olap4j.OlapWrapper
isWrapperFor, unwrap
 

Method Detail

getMetaData

OlapDatabaseMetaData getMetaData()
                                 throws OlapException

Specified by:
getMetaData in interface java.sql.Connection
Throws:
OlapException - if database error occurs

prepareOlapStatement

PreparedOlapStatement prepareOlapStatement(java.lang.String mdx)
                                           throws OlapException
Creates a prepared OLAP Statement.

This method is the equivalent, for OLAP, of the Connection.prepareStatement(String) JDBC method.

Parameters:
mdx - MDX query string
Returns:
prepared statement
Throws:
OlapException - if database error occurs

getParserFactory

MdxParserFactory getParserFactory()
Returns the factory used to create MDX parsers in this connection.

Returns:
MDX parser factory

createStatement

OlapStatement createStatement()
                              throws OlapException

Specified by:
createStatement in interface java.sql.Connection
Throws:
OlapException - if database error occurs

getSchema

Schema getSchema()
                 throws OlapException
Returns the current Schema of this connection.

Returns:
current Schema
Throws:
OlapException - if database error occurs

getCatalogs

NamedList<Catalog> getCatalogs()
Returns a list of Catalog objects which belong to this connection's OLAP server.

The caller should assume that the list is immutable; if the caller modifies the list, behavior is undefined.

Returns:
List of Catalogs in this connection's OLAP server
See Also:
DatabaseMetaData.getCatalogs()

setLocale

void setLocale(java.util.Locale locale)
Sets the current locale of this connection. The value must not be null.

If the locale is not set, the JDK's current locale is used (see Locale.getDefault()).

Most drivers support a Locale connect-string property.

Parameters:
locale - Locale

getLocale

java.util.Locale getLocale()
Returns this connection's locale. The value is never null.

Returns:
locale of this connection

setRoleName

void setRoleName(java.lang.String roleName)
                 throws OlapException
Sets the name of the role in which this connection executes queries. If the name of the role is null, the connection reverts to the default access control context.

Parameters:
roleName - Name of role
Throws:
OlapException - if role name is invalid

getRoleName

java.lang.String getRoleName()
Returns the name of the role in which this connection executes queries.

Returns:
name of the role in which this connection executes queries

createScenario

Scenario createScenario()
Creates a Scenario.

It does not become the active scenario for the current connection. To do this, call setScenario(Scenario).

Returns:
a new Scenario
See Also:
setScenario(org.olap4j.Scenario)

setScenario

void setScenario(Scenario scenario)
Sets the active Scenario of this connection.

After setting a scenario, the client may call Cell.setValue(java.lang.Object, org.olap4j.AllocationPolicy, java.lang.Object...) to change the value of cells returned from queries. The value of those cells is changed. This operation is referred to as 'writeback', and is used to perform 'what if' analysis, such as budgeting. See Scenario for more details.

If scenario is null, the connection will have no active scenario, and writeback is not allowed.

Scenarios are created using createScenario().

Parameters:
scenario - Scenario

getScenario

Scenario getScenario()
Returns this connection's active Scenario, or null if there is no active Scenario.

Returns:
Active scenario, or null

SourceForge.net_Logo