|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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 the
java.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, write
to create a JDBC 3.0 connection and convert it to an olap4j connection.import 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 its isWrapper
and unwrap
methods
without casting. For instance, write
to create a JDBC 4.0 connection and convert it to an olap4j connection.import java.sql.Connection; import java.sql.DriverManager; import org.olap4j.OlapConnection; Connection connection = DriverManager.getConnection("jdbc: ..."); OlapConnection olapConnection = connection.unwrap(OlapConnection.class);
Method Summary | ||
---|---|---|
boolean |
isWrapperFor(java.lang.Class<?> iface)
|
|
|
unwrap(java.lang.Class<T> iface)
|
Method Detail |
---|
<T> T unwrap(java.lang.Class<T> iface) throws java.sql.SQLException
java.sql.SQLException
boolean isWrapperFor(java.lang.Class<?> iface) throws java.sql.SQLException
java.sql.SQLException
|
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |