I have setup datasource in server.xml in tomcat like below
<Context
docBase="C:/Java_WS/GIT WS/reportingsuite/reporting-api/target/reporting-api-0.0.1-SNAPSHOT"
path="" reloadable="true">
<Resource name="jdbc/postgres"
auth="Container"
provider="mondrian"
type="javax.sql.DataSource"
driverClassName="org.postgresql.Driver"
jdbcdrivers="mondrian.olap4j.MondrianOlap4jDriver"
Catalog="C:\Java_WS\GIT WS\reportingsuite\reporting-api\src\main\webapp\WEB-INF\Schema1.xml"
url="jdbc:postgresql://localhost:5432/postgres"
username="postgres"
password="password"
maxActive="20"
maxIdle="10"
maxWait="-1"
accessToUnderlyingConnectionAllowed="true" />
</Context>
Using the following java code to get the datasource and trying to create olapconnection ..
Context ctx = new InitialContext();
DataSource ds = (DataSource) ctx.lookup("java:/comp/env/jdbc/postgres");
this.connection = ds.getConnection();
this.olapConnection = connection.unwrap(OlapConnection.class);
At the last line am getting the exception ..
org.postgresql.util.PSQLException: Method org.postgresql.jdbc4.Jdbc4Connection.unwrap(Class<T>) is not yet implemented
I had tried various options available over internet but it does not seem to be working .. can someone please help here.