MDX
요청에서 모든 데이터를 가져 오려고합니다. 예를 들어 결과의 모든 행에 foreach
을 입력하고 싶습니다. 나는 다음과 같은 코드를 가지고 : 나는 result.getCell(new int[]{0,0})
을 시도MDX 요청에서 데이터 가져 오기 Mondrian
String cnxURL =
"Jdbc=jdbc:" +
"postgresql://localhost/foodmart;" +
"JdbcDrivers=org.postgresql.Driver;" +
"JdbcUser=postgres;" +
"JdbcPassword=postgres;" +
"Catalog=file:../queries/FoodMart.xml;";
Connection connection = DriverManager.getConnection(cnxURL, null);
String query = "Select ...";
Query q = connection.parseQuery(query);
Result result = connection.execute(q);
을,하지만 난 얼마나 많은 행이 알고 무엇 차원 내 결과가 없습니다. 또한 PrintWriter
을 다음과 같이 사용하려고했습니다.
File f = new File("output");
try {
PrintWriter pw = new PrintWriter(f);
result.print(pw);
}
catch (FileNotFoundException e) {}
그러나 10 개 중 하나의 쿼리 만 인쇄되었습니다.
여기서 내가 뭘 잘못하고 있니? 어떻게 작동시킬 수 있습니까?
감사합니다. 그것은 저의 해결책에 가깝게 만들었습니다. 그러나 모든 예제는'PrintWriter'를 사용합니다.이 값은 별도의 셀에 값으로 접근하는 데 도움이되지 않습니다. – theDilletante