Package org.olap4j
Interface OlapWrapper
-
- All Known Subinterfaces:
CellSet
,CellSetMetaData
,OlapConnection
,OlapDatabaseMetaData
,OlapStatement
,PreparedOlapStatement
public interface OlapWrapper
Interface for olap4j classes which provide the ability to retrieve the delegate instance when the instance in question is in fact a proxy class.OlapWrapper
duplicates the functionality of thejava.sql.Wrapper
interface (introduced in JDBC 4.0), making this functionality available to olap4j clients running in a JDBC 3.0 environment. For code which will run only on JDBC 4.0 and later, Wrapper can be used, and OlapWrapper can be ignored.In JDBC 3.0 (JDK 1.5) and earlier, the
OlapWrapper
interface is used to convert a JDBC class to the corresponding olap4j class. For instance, writeimport java.sql.Connection; import java.sql.DriverManager; import org.olap4j.OlapConnection; import org.olap4j.OlapWrapper; Connection connection = DriverManager.getConnection("jdbc: ..."); OlapWrapper wrapper = (OlapWrapper) connection; OlapConnection olapConnection = wrapper.unwrap(OlapConnection.class);
In JDBC 4.0 (JDK 1.6) and later, you don't need to use this class. All of the key JDBC classes implement
java.sql.Wrapper
interface, so you can use itsisWrapper
andunwrap
methods without casting. For instance, writeimport java.sql.Connection; import java.sql.DriverManager; import org.olap4j.OlapConnection; Connection connection = DriverManager.getConnection("jdbc: ..."); OlapConnection olapConnection = connection.unwrap(OlapConnection.class);
- Since:
- Jun 14, 2007
- Author:
- jhyde
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
isWrapperFor(java.lang.Class<?> iface)
<T> T
unwrap(java.lang.Class<T> iface)
-