code: public void close() throws SQLException {
      isClosed = true;
      if (!isEof) {
        lock.lock();
        try {
          while (!isEof) {
            dataSize = 0; //to avoid storing data
            readNextValue();
          }
  
        } catch (SQLException queryException) {
          throw ExceptionMapper.getException(queryException, null, this.statement, false);
        } catch (IOException ioe) {
          throw handleIoException(ioe);
        } finally {
          resetVariables();
          lock.unlock();
        }
      }
      resetVariables();
  
      //keep garbage easy
      for (int i = 0; i < data.length; i++) {
        data[i] = null;
      }
  
      if (statement != null) {
        statement.checkCloseOnCompletion(this);
        statement = null;
      }
    }
docs: Close resultSet.