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{