当前位置: 首页>>代码示例>>Java>>正文


Java AvaticaStatement.getResultSet方法代码示例

本文整理汇总了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();
  }
}
 
开发者ID:apache,项目名称:calcite-avatica,代码行数:22,代码来源:RemoteMetaTest.java

示例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();
  }
}
 
开发者ID:apache,项目名称:calcite-avatica,代码行数:23,代码来源:RemoteMetaTest.java


注:本文中的org.apache.calcite.avatica.AvaticaStatement.getResultSet方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。