Package mondrian.rolap

Examples of mondrian.rolap.RolapConnection


                RolapConnectionProperties.Catalog.name());
            properties.put(
                RolapConnectionProperties.Catalog.name(),
                locator.locate(catalog));
        }
        return new RolapConnection(properties, dataSource);
    }
View Full Code Here


  }

  public boolean clearCache() throws Exception {
    if (olapConnection.isWrapperFor(RolapConnection.class)) {
      System.out.println("Clearing cache");
      RolapConnection rcon = olapConnection.unwrap(RolapConnection.class);
      rcon.getCacheControl(null).flushSchemaCache();

    }
    return true;
  }
View Full Code Here

        && ISaikuConnection.OLAP_DATASOURCE.equals(con.getDatasourceType())
        && con.getConnection() instanceof OlapConnection)
    {
      OlapConnection olapCon = (OlapConnection) con.getConnection();
      try {
        RolapConnection rCon = olapCon.unwrap(RolapConnection.class);
      } catch (SQLException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
      }
      //rCon.setRole(myCustomRoleImplementation);
View Full Code Here

    }
    return null;
  }

  public static MondrianServer getMondrianServer(OlapConnection con) {
    RolapConnection rcon = getMondrianConnection(con);
    return rcon != null ? rcon.getServer() : null;
  }
View Full Code Here

  }

  public static boolean isMondrianDrillthrough(OlapConnection con, String mdx) {
    boolean isMondrian = isMondrianConnection(con);
    if (isMondrian) {
      RolapConnection rcon = getMondrianConnection(con);
      QueryPart qp = rcon.parseStatement(mdx);
      return (qp != null && qp instanceof DrillThrough);
    }
    return false;
  }
View Full Code Here

    if (roleNames == null) {
      con.setRoleName(null);
      return;
    }
    MondrianOlap4jConnection mcon = (MondrianOlap4jConnection) con;
    RolapConnection rcon = getMondrianConnection(mcon);
    Schema schema = rcon.getSchema();
    List<Role> roleList = new ArrayList<Role>();
    Role role;
    for (String roleName : roleNames) {
      Role role1 = schema.lookupRole(roleName);
      if (role1 == null) {
        throw Util.newError(
            "Role '" + roleName + "' not found");
      }
      roleList.add(role1);
    }
    switch (roleList.size()) {
    case 0:
      role = null;
      break;
    case 1:
      role = roleList.get(0);
      break;
    default:
      role = RoleImpl.union(roleList);
      break;
    }
    rcon.setRole(role);
  }
View Full Code Here

      Annotation a = ann.get(annotation);
      String sql = a.getValue().toString();

      log.debug("Level SQLMember Lookup for " + level.getName() + " sql:[" + sql + "] parameter [" + search + "]");

      RolapConnection rcon = con.unwrap(RolapConnection.class);
      DataSource ds = rcon.getDataSource();
      Connection sqlcon = ds.getConnection();
      PreparedStatement stmt = sqlcon.prepareCall(sql);
      stmt.setString(1, search);
      ResultSet rs = stmt.executeQuery();
      return rs;
View Full Code Here

      RolapConnectionProperties.Locale.name(),
      getLocale().toString() );
    OlapConnection conn = mock( OlapConnection.class );
    when( server.getConnection( "Pentaho", "myHostedServer", null, properties ) ).thenReturn( conn );
    when( conn.isWrapperFor( any( Class.class ) ) ).thenReturn( true );
    final RolapConnection rolapConn = mock( RolapConnection.class );
    when( conn.unwrap( any( Class.class ) ) ).thenReturn( rolapConn );
    when( rolapConn.getCacheControl( any( PrintWriter.class ) ) ).thenThrow(
      new RuntimeException( "something happend" ) );
    try {
      olapService.flushAll( session );
    } catch ( IOlapServiceException e ) {
      fail( "Exception shouldn't have made it this far." );
View Full Code Here

                RolapConnectionProperties.Catalog.name());
            properties.put(
                RolapConnectionProperties.Catalog.name(),
                locator.locate(catalog));
        }
        final RolapConnection connection =
            new RolapConnection(server, properties, dataSource);
        server.addConnection(connection);
        return connection;
    }
View Full Code Here

    }

    public NamedList<MondrianOlap4jMember> getChildMembers()
        throws OlapException
    {
        final RolapConnection conn =
            olap4jSchema.olap4jCatalog.olap4jDatabaseMetaData
                .olap4jConnection.getMondrianConnection();
        final List<mondrian.olap.Member> children =
            Locus.execute(
                conn,
                "MondrianOlap4jMember.getChildMembers",
                new Locus.Action<List<mondrian.olap.Member>>() {
                    public List<mondrian.olap.Member> execute() {
                        return
                            conn.getSchemaReader()
                                .getMemberChildren(member);
                    }
                });
        return new AbstractNamedList<MondrianOlap4jMember>() {
            public String getName(Object member) {
View Full Code Here

TOP

Related Classes of mondrian.rolap.RolapConnection

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.