@Override
  public int getMaxRows() throws SQLException {
    checkConnection("getMaxRows");
    return maxRows;
  }
Close statement if needed, and reset the flags.
@throws SQLException
jdbc/src/java/org/apache/hive/jdbc/HiveStatement.java