Java Code Examples for org.apache.calcite.avatica.AvaticaUtils#setLargeMaxRows()

The following examples show how to use org.apache.calcite.avatica.AvaticaUtils#setLargeMaxRows() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: QuicksqlServerMeta.java    From Quicksql with MIT License 5 votes vote down vote up
/**
 * Sets the provided maximum number of rows on the given statement.
 *
 * @param statement The JDBC Statement to operate on
 * @param maxRowCount The maximum number of rows which should be returned for the query
 */
void setMaxRows(Statement statement, long maxRowCount) throws SQLException {
    // Special handling of maxRowCount as JDBC 0 is unlimited, our meta 0 row
    if (maxRowCount > 0) {
        AvaticaUtils.setLargeMaxRows(statement, maxRowCount);
    } else if (maxRowCount < 0) {
        statement.setMaxRows(0);
    }
}
 
Example 2
Source File: JdbcMeta.java    From calcite-avatica with Apache License 2.0 5 votes vote down vote up
/**
 * Sets the provided maximum number of rows on the given statement.
 *
 * @param statement The JDBC Statement to operate on
 * @param maxRowCount The maximum number of rows which should be returned for the query
 */
void setMaxRows(Statement statement, long maxRowCount) throws SQLException {
  // Special handling of maxRowCount as JDBC 0 is unlimited, our meta 0 row
  if (maxRowCount > 0) {
    AvaticaUtils.setLargeMaxRows(statement, maxRowCount);
  } else if (maxRowCount < 0) {
    statement.setMaxRows(0);
  }
}