public class XmlaOlap4jDriver extends Object implements Driver
Since olap4j is a superset of JDBC, you register this driver as you would any JDBC driver:
Class.forName("org.olap4j.driver.xmla.XmlaOlap4jDriver");
Then create a connection using a URL with the prefix "jdbc:xmla:".
For example,
import java.sql.Connection;
import java.sql.DriverManager;
import org.olap4j.OlapConnection;
Connection connection =
DriverManager.getConnection(
"jdbc:xmla:");
OlapConnection olapConnection =
connection.unwrap(OlapConnection.class);
Note how we use the java.sql.Connection#unwrap(Class) method to down-cast
the JDBC connection object to the extension OlapConnection
object. This method is only available in JDBC 4.0 (JDK 1.6 onwards).
Unless otherwise stated, properties are optional. If a property occurs multiple times in the connect string, the first occurrence is used.
It is also possible to pass properties to the server end-point using
JDBC connection properties as part of the XMLA driver connection properties.
If the JDBC URL contains properties that are not enumerated in
XmlaOlap4jDriver.Property
, they will be included as part of the SOAP PropertyList
element.
Property | Description |
---|---|
Server | URL of HTTP server. Required. |
Catalog | Catalog name to use. By default, the first one returned by the XMLA server will be used. |
Schema | Schema name to use. By default, the first one returned by the XMLA server will be used. |
Database | Name of the XMLA database. By default, the first one returned by the XMLA server will be used. |
Cache | Class name of the SOAP cache to use.
Must implement interface
By default, no SOAP query cache will be used. |
Cache.* | Properties to transfer to the selected cache
implementation. See
XmlaOlap4jCache
or your selected implementation for properties
details.
|
TestProxyCookie | String that uniquely identifies a proxy
object in PROXY_MAP via which to
send XMLA requests for testing
purposes.
|
Role | Comma separated list of role names used for
this connection (Optional). Available role names can be retrieved via XmlaOlap4jConnection.getAvailableRoleNames()
|
User | User name to use when establishing a connection to the server. The credentials are passed using the HTTP Basic authentication protocol, but are also sent as part of the SOAP Security headers. |
Password | Password to use when establishing a connection to the server. The credentials are passed using the HTTP Basic authentication protocol, but are also sent as part of the SOAP Security headers. |
Modifier and Type | Class and Description |
---|---|
static class |
XmlaOlap4jDriver.Property
Properties supported by this driver.
|
Modifier and Type | Field and Description |
---|---|
static Map<String,XmlaOlap4jProxy> |
PROXY_MAP
For testing.
|
Constructor and Description |
---|
XmlaOlap4jDriver()
Creates an XmlaOlap4jDriver.
|
Modifier and Type | Method and Description |
---|---|
boolean |
acceptsURL(String url) |
Connection |
connect(String url,
Properties info) |
static Future<byte[]> |
getFuture(XmlaOlap4jProxy proxy,
XmlaOlap4jServerInfos serverInfos,
String request)
Returns a future object representing an asynchronous submission of an
XMLA request to a URL.
|
int |
getMajorVersion() |
int |
getMinorVersion() |
Logger |
getParentLogger() |
DriverPropertyInfo[] |
getPropertyInfo(String url,
Properties info) |
String |
getVersion()
Returns the driver version.
|
boolean |
jdbcCompliant() |
static String |
nextCookie()
Generates and returns a unique string.
|
public static final Map<String,XmlaOlap4jProxy> PROXY_MAP
public XmlaOlap4jDriver()
public Connection connect(String url, Properties info) throws SQLException
connect
in interface Driver
SQLException
public boolean acceptsURL(String url) throws SQLException
acceptsURL
in interface Driver
SQLException
public DriverPropertyInfo[] getPropertyInfo(String url, Properties info) throws SQLException
getPropertyInfo
in interface Driver
SQLException
public String getVersion()
public int getMajorVersion()
getMajorVersion
in interface Driver
public int getMinorVersion()
getMinorVersion
in interface Driver
public boolean jdbcCompliant()
jdbcCompliant
in interface Driver
public Logger getParentLogger()
getParentLogger
in interface Driver
public static Future<byte[]> getFuture(XmlaOlap4jProxy proxy, XmlaOlap4jServerInfos serverInfos, String request)
proxy
- Proxy via which to send the requestserverInfos
- Server infos.request
- Requestpublic static String nextCookie()