PreparedStatement statement = connection.unwrap(RelRunner.class).prepare(rootRel);
ResultSet resultSet = statement.executeQuery();
直接使用する
RelRunners
/*
....................
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements.
...................
*/
public class RelRunners {
private RelRunners() {}
/** Runs a relational expression by creating a JDBC connection. */
public static PreparedStatement run(RelNode rel) {
try (Connection connection = DriverManager.getConnection("jdbc:calcite:")) {
final RelRunner runner = connection.unwrap(RelRunner.class);
return runner.prepare(rel);
} catch (SQLException e) {
throw new RuntimeException(e);
}
}
}