Package org.olap4j

Examples of org.olap4j.OlapWrapper


      return new OlapQueryExecution(command, unwrap(connection), executionContext, this);
  }   

  private OlapConnection unwrap(Connection conn) throws TranslatorException {
      try {
        OlapWrapper wrapper = conn.unwrap(OlapWrapper.class);
        OlapConnection olapConn = wrapper.unwrap(OlapConnection.class);
        return olapConn;
      } catch(SQLException e) {
        throw new TranslatorException(e);
      }   
  }
View Full Code Here


                + "User='admin';"
                + "Password='admin';"
                + "Catalog=FoodMart2005Palo;"
                + "Cube=Budget");

        OlapWrapper wrapper = (OlapWrapper) connection;

        OlapConnection olapConnection = wrapper.unwrap(OlapConnection.class);

        OlapStatement statement = olapConnection.createStatement();

        CellSet cellSet =
            statement.executeOlapQuery(
View Full Code Here

    {
      return (OlapConnection) connection;
    }
    if (connection instanceof OlapWrapper)
    {
      final OlapWrapper wrapper = (OlapWrapper) connection;
      return wrapper.unwrap(OlapConnection.class);
    }
    throw new SQLException("Unable to unwrap the connection: " + driver); //$NON-NLS-1$
  }
View Full Code Here

        {
          return (OlapConnection) connection;
        }
        if (connection instanceof OlapWrapper)
        {
          final OlapWrapper wrapper = (OlapWrapper) connection;
          return wrapper.unwrap(OlapConnection.class);
        }
        throw new SQLException("Unable to unwrap the connection: " + connectionPath); //$NON-NLS-1$
      }

      final Connection connection = ds.getConnection(realUser, realPassword);
      if (connection == null)
      {
        throw new SQLException("JNDI DataSource is invalid; it returned null without throwing a meaningful error.");
      }
      if (connection instanceof OlapConnection)
      {
        return (OlapConnection) connection;
      }
      if (connection instanceof OlapWrapper)
      {
        final OlapWrapper wrapper = (OlapWrapper) connection;
        return wrapper.unwrap(OlapConnection.class);
      }
      throw new SQLException("Unable to unwrap the connection: " + connectionPath); //$NON-NLS-1$
    }
    catch (NamingException ne)
    {
View Full Code Here

        {
          return (OlapConnection) connection;
        }
        if (connection instanceof OlapWrapper)
        {
          final OlapWrapper wrapper = (OlapWrapper) connection;
          return wrapper.unwrap(OlapConnection.class);
        }
        throw new SQLException("Unable to unwrap the connection: " + connectionPath); //$NON-NLS-1$
      }

      final Connection connection = ds.getConnection(realUser, realPassword);
      if (connection == null)
      {
        throw new SQLException("JNDI DataSource is invalid; it returned null without throwing a meaningful error.");
      }
      if (connection instanceof OlapConnection)
      {
        return (OlapConnection) connection;
      }
      if (connection instanceof OlapWrapper)
      {
        final OlapWrapper wrapper = (OlapWrapper) connection;
        return wrapper.unwrap(OlapConnection.class);
      }

      return connection.unwrap(OlapConnection.class);
    }
    catch (DatasourceServiceException ne)
View Full Code Here

    {
      return (OlapConnection) connection;
    }
    if (connection instanceof OlapWrapper)
    {
      final OlapWrapper wrapper = (OlapWrapper) connection;
      final OlapConnection olapConnection = wrapper.unwrap(OlapConnection.class);
      if (olapConnection == null)
      {
        throw new SQLException("Unable to unwrap the connection: " + driver); //$NON-NLS-1$
      }
      return olapConnection;
View Full Code Here

      } else {
        connection = (OlapConnection) DriverManager.getConnection(
            connectStr, username, password);
      }

      final OlapWrapper wrapper = connection;

      final OlapConnection olapConnection = wrapper
          .unwrap(OlapConnection.class);

      if (olapConnection == null) {
        throw new OlapException("Services.Session.NullConnection"); //$NON-NLS-1$
      } else {
View Full Code Here

    Class.forName(driver);
    Connection object = DriverManager.getConnection(url, username, password);
    OlapConnection connection;
    connection = (OlapConnection) DriverManager.getConnection(url, username, password);
    final OlapWrapper wrapper = connection;
    OlapConnection tmpolapConnection = wrapper.unwrap(OlapConnection.class);


    if (tmpolapConnection == null) {
      throw new Exception("Connection is null");
    }
View Full Code Here

            // ignore
        } catch (IllegalAccessException e) {
            // ignore
        }
        if (connection instanceof OlapWrapper) {
            OlapWrapper olapWrapper = (OlapWrapper) connection;
            return olapWrapper.unwrap(clazz);
        }
        throw new SQLException("not an instance");
    }
View Full Code Here

TOP

Related Classes of org.olap4j.OlapWrapper

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.