2013-05-24 1 views
1

몬드리안과 DRILLTHROUGH 검색어를 어떻게 사용합니까?Mondrian OLAP와 함께 DRILLTHROUGH를 사용하는 방법?

OlapConnection connection = DriverManager.getConnection(connection_string).unwrap(OlapConnection.class); 
connection.createStatement.executeOlapQuery(mdx); 

나는 또한 실험을 다음과 같이

코드에서
java.lang.ClassCastException: mondrian.olap.DrillThrough cannot be cast to mondrian.olap.Query 
    at mondrian.olap4j.MondrianOlap4jStatement$1.execute(MondrianOlap4jStatement.java:362) 
    at mondrian.olap4j.MondrianOlap4jStatement$1.execute(MondrianOlap4jStatement.java:360) 
    at mondrian.server.Locus.execute(Locus.java:87) 
    at mondrian.server.Locus.execute(Locus.java:72) 
    at mondrian.olap4j.MondrianOlap4jStatement.parseQuery(MondrianOlap4jStatement.java:356) 
    at mondrian.olap4j.MondrianOlap4jStatement.executeOlapQuery(MondrianOlap4jStatement.java:346) 

, 내가 문에 MDX의 문자열을 전달하고있다 : 예를 들어,이 MDX 쿼리

DRILLTHROUGH 
SELECT 
    measures.MEMBERS ON 0 
FROM 
    events 

에 대한 예외를 생성 CelldrillThrough을 호출하면 예외가 발생하지만 결과는 org.postgresql.util.PSQLException: FATAL: sorry, too many clients already입니다. 아마도 나는 제대로 연결을 관리하지 않을 것입니까? 내 다른 질문 : Mondrian OLAP connection management을 참조하십시오.

답변

2

드릴 스루 작업은 ResultSet의 (일반 JDBC API를 구현)을 반환합니다, 그래서 당신은 대신를 사용해야합니다 :

olapConnection.createStatement().executeQuery(String mdx) 
+0

감사합니다. 따라서 JDBC API를 사용하여 낮은 수준의 추상화를 암묵적으로 조작하고 있습니다. 내 의도가 DRILLDOWN에 대한 지원으로 내 고객에게 MDX를 노출하는 것이라면 권장되는 접근 방법은 무엇입니까? 먼저 MDX를 구문 분석 한 다음 AST를 검사하여 OLAP 또는 JDBC API 사용 여부를 결정할 수 있습니까? –

+0

DRILLTHROUGH는 예약어이므로 따옴표로 묶지 않은/이스케이프 처리되지 않은 쿼리가 드릴 스루 인 것으로 가정하는 것이 안전합니다. – Luc