I have to convert this code from Java to Scala:
Connection connection = DriverManager.getConnection("jdbc: ...");
OlapConnection olapConnection = connection.unwrap(OlapConnection.class);
Problem is to convert the unwrap
parameter. This is my attempt in Scala:
val connection = DriverManager.getConnection("jdbc: ...")
val olapConnection = connection.unwrap(OlapConnection.getClass)
I get the error in OlapConnection.getClass
:
value getClass is not a member of object org.olap4j.OlapConnection Note that OlapConnection extends Any, not AnyRef. Such types can participate in value classes, but instances cannot appear in singleton types or in reference comparisons.
What is the equivalent of the unwrap parameter in Scala?