Package oracle.AWXML

Examples of oracle.AWXML.AWConnection


    // Create the AWConnection.
    try
    {
      // System.out.println("Connecting to " + connection + ".");
      awConnection = new AWConnection(user, password, connection);
    }
    catch(Exception e)
    {
      System.out.println("Error connecting to " + connection + ".\n"  + e);
    }
View Full Code Here


    // Create the AWConnection.
    try
    {
      // System.out.println("Connecting to " + connection + ".");
      awConnection = new AWConnection(user, password, connection);
    }
    catch(Exception e)
    {
      System.out.println("Error connecting to " + connection + ".\n"  + e);
    }
View Full Code Here

    // Create the AWConnection.
    try
    {
      // System.out.println("Connecting to " + connection + ".");
      awConnection = new AWConnection(user, password, connection);
    }
    catch(Exception e)
    {
      System.out.println("Error connecting to " + connection + ".\n"  + e);
    }
View Full Code Here

    List<String> cubes = new ArrayList<String>();
    cubes.add(cube);
    return maintain(isFull,null,cubes);
  }
  public static synchronized OperResult maintain(boolean isFull,List<String> dims,List<String> cubes){
    AWConnection awConnection = null;//分析工作空间连接
    OperResult result = new OperResult();
    Connection connection = null;
    try {
      Object bdd = StorageService.ctx.getBean("olapdatasource");
      if(bdd instanceof org.apache.tomcat.dbcp.dbcp.BasicDataSource){
        org.apache.tomcat.dbcp.dbcp.BasicDataSource bds = (BasicDataSource)bdd;
        Connection conn1 = bds.getConnection();
        if(conn1 instanceof org.apache.tomcat.dbcp.dbcp.DelegatingConnection){
          org.apache.tomcat.dbcp.dbcp.DelegatingConnection dc = (org.apache.tomcat.dbcp.dbcp.DelegatingConnection)conn1;
          connection = dc.getInnermostDelegate();
        }
      }else if(bdd instanceof org.jsoftware.fods.impl.FoDataSourceImpl){
        org.jsoftware.fods.impl.FoDataSourceImpl bds = (org.jsoftware.fods.impl.FoDataSourceImpl)bdd;
        connection = bds.getConnection().getMetaData().getConnection();
      }

      if(connection==null ){
        result.setFailed(OLAP_CONNECTION_NOT_AVAILABLE);
        return result;
      }
     
      OracleConnection conn = (OracleConnection) connection;
      try{
        awConnection = new AWConnection(conn);
      }catch(Exception e){
        result.setFailed(e.getMessage());
        e.printStackTrace();
        return result;
      }
      Interaction curInteraction = new Interaction();

        // Set the AWConnection to use when building the analytic workspace.
        curInteraction.setConnection(awConnection);

        // Create an BuildDatabase object.
        BuildDatabase myBuild =
                 (BuildDatabase)curInteraction.createAction("BUILDDATABASE");

        // Set the name of the analytic workspace.
        myBuild.setAWName(WebVariable.AW_GLOBAL_ID);//挂载分析空间global.global

        // Specify not running solves when building the database.
       
        myBuild.setBuildType("EXECUTE");
//        myBuild.setRunSolve(true);
        myBuild.setCleanMeasures(false);
        myBuild.setCleanAttrs(false);
        myBuild.setCleanDim(true);
        myBuild.setTrackStatus(true);
       
//        myBuild.setId("simple");
        /**!
         * TrackStatus
         * true只导入增量数据
         * false全数据导入
         */
//        myBuild.setTrackStatus(isFull);
        myBuild.setMaxJobQueues(0);
        if(dims!=null){
          for(String dimid:dims){
            Dimension dim = new Dimension();
            dim.setId(dimid);
            myBuild.addBuildList(dim);
          }
        }
        if(cubes!=null){
          for(String cubeid:cubes){
            Cube cube = new Cube();
            cube.setId(cubeid);
            myBuild.addBuildList(cube);
          }
        }
       
        myBuild.Execute();
        awConnection.executeCommand("aw detach "+WebVariable.AW_GLOBAL_ID);
        result.setSucceed(getOLAPLog(conn));
        awConnection.close();
        conn.close();
       
    } catch (Exception e) {
      e.printStackTrace();
      result.setFailed(OLAP_MAINTAIN_FAILED,e.getMessage());
    } finally{
      if(awConnection!=null){
        awConnection.close();
        awConnection = null;
      }
    }
    return result;
  }
View Full Code Here

    return executeCalPlan(solveGroups);
  }
 
  public static synchronized OperResult executeCalPlan(List<String>solveGroups)//执行计算计划
  {
    AWConnection awConnection = null;//分析工作空间连接
    OperResult result = new OperResult();
    Connection connection = null;
    try {
      Object bdd = StorageService.ctx.getBean("olapdatasource");
      if(bdd instanceof org.apache.tomcat.dbcp.dbcp.BasicDataSource){
        org.apache.tomcat.dbcp.dbcp.BasicDataSource bds = (BasicDataSource)bdd;
        Connection conn1 = bds.getConnection();
        if(conn1 instanceof org.apache.tomcat.dbcp.dbcp.DelegatingConnection){
          org.apache.tomcat.dbcp.dbcp.DelegatingConnection dc = (org.apache.tomcat.dbcp.dbcp.DelegatingConnection)conn1;
          connection = dc.getInnermostDelegate();
        }
      }

      if(connection==null || !(connection instanceof OracleConnection)){
        result.setFailed(OLAP_CONNECTION_NOT_AVAILABLE);
        return result;
      }
      OracleConnection conn = (OracleConnection) connection;
      try{
        awConnection = new AWConnection(conn);
      }catch(Exception e){
        result.setFailed(e.getMessage());
        e.printStackTrace();
        return result;
      }
      Interaction curInteraction = new Interaction();

        // Set the AWConnection to use when building the analytic workspace.
        curInteraction.setConnection(awConnection);

        // Create an BuildDatabase object.
        BuildDatabase myBuild =
                 (BuildDatabase)curInteraction.createAction("BUILDDATABASE");

        // Set the name of the analytic workspace.
        myBuild.setAWName(WebVariable.AW_GLOBAL_ID);//挂载分析空间global.global

        // Specify not running solves when building the database.
       
        myBuild.setBuildType("EXECUTE");
        myBuild.setRunSolve(true);
       
        if(solveGroups!=null)
        {
          for(String solveGroupid:solveGroups)
          {
            SolveGroup solveGroup = new SolveGroup();//计算计划属于SolveGroup型
            solveGroup.setId(solveGroupid);
            myBuild.addBuildList(solveGroup);
          }
        }
        myBuild.Execute();
        awConnection.executeCommand("aw detach "+WebVariable.AW_GLOBAL_ID);
        result.setSucceed(getOLAPLog(conn));
        awConnection.close();
        conn.close();
    }
    catch (Exception e)
    {
      e.printStackTrace();
      result.setFailed(CALCULATE_PLAN_EXECUTE_FAILED,e.getMessage());
    }
    finally
    {
      awConnection.close();
    }
    return result;
  }
View Full Code Here

TOP

Related Classes of oracle.AWXML.AWConnection

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.