本文整理汇总了Java中org.apache.calcite.avatica.AvaticaStatement.getResultSet方法的典型用法代码示例。如果您正苦于以下问题:Java AvaticaStatement.getResultSet方法的具体用法?Java AvaticaStatement.getResultSet怎么用?Java AvaticaStatement.getResultSet使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.calcite.avatica.AvaticaStatement
的用法示例。
在下文中一共展示了AvaticaStatement.getResultSet方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testRemoteExecuteMaxRowCount
import org.apache.calcite.avatica.AvaticaStatement; //导入方法依赖的package包/类
@Test public void testRemoteExecuteMaxRowCount() throws Exception {
ConnectionSpec.getDatabaseLock().lock();
try (AvaticaConnection conn = (AvaticaConnection) DriverManager.getConnection(url)) {
final AvaticaStatement statement = conn.createStatement();
prepareAndExecuteInternal(conn, statement,
"select * from (values ('a', 1), ('b', 2))", 0);
ResultSet rs = statement.getResultSet();
int count = 0;
while (rs.next()) {
count++;
}
assertEquals("Check maxRowCount=0 and ResultSets is 0 row", count, 0);
assertEquals("Check result set meta is still there",
rs.getMetaData().getColumnCount(), 2);
rs.close();
statement.close();
conn.close();
} finally {
ConnectionSpec.getDatabaseLock().unlock();
}
}
示例2: checkLargeQuery
import org.apache.calcite.avatica.AvaticaStatement; //导入方法依赖的package包/类
private void checkLargeQuery(int n) throws Exception {
try (AvaticaConnection conn = (AvaticaConnection) DriverManager.getConnection(url)) {
final AvaticaStatement statement = conn.createStatement();
final String frenchDisko = "It said human existence is pointless\n"
+ "As acts of rebellious solidarity\n"
+ "Can bring sense in this world\n"
+ "La resistance!\n";
final String sql = "select '"
+ longString(frenchDisko, n)
+ "' as s from (values 'x')";
prepareAndExecuteInternal(conn, statement, sql, -1);
ResultSet rs = statement.getResultSet();
int count = 0;
while (rs.next()) {
count++;
}
assertThat(count, is(1));
rs.close();
statement.close();
conn.close();
}
}