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