문제

I am trying to get all the data from an MDX request. For example, I want to foreach every row in the result. I have the following code:

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);

I tried result.getCell(new int[]{0,0}), but I don't know how many rows and what dimension my result has. I also tried to use PrintWriter like:

File f = new File("output");
try {
    PrintWriter pw = new PrintWriter(f);
    result.print(pw);
}
catch (FileNotFoundException e) {}

but only one query out of ten got printed.

What am i doing wrong here? How can get this working?

도움이 되었습니까?

다른 팁

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top