com.yandex.ydb.examples.simple.DataQueryResults Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ydb-sdk-examples Show documentation
Show all versions of ydb-sdk-examples Show documentation
Examples of usage Java SDK for Yandex Database (YDB)
package com.yandex.ydb.examples.simple;
import com.yandex.ydb.examples.TablePrinter;
import com.yandex.ydb.table.query.DataQueryResult;
/**
* @author Sergey Polovko
*/
public class DataQueryResults {
static void print(DataQueryResult result) {
if (result.isEmpty()) {
System.out.println("results ");
return;
}
System.out.println("result txId: " + result.getTxId());
for (int i = 0; i < result.getResultSetCount(); i++) {
System.out.printf("-- [ result set #%d ] --\n", i);
new TablePrinter(result.getResultSet(i)).print();
}
}
}