_rs.setAffectedRows(_affectedRows);
if (_rs != null) _rs.setAffectedRows(_affectedRows);
  private Value real_query(String sql)  {    clearErrors();    // Empty _resultValues on new call to query    // But DO NOT close the individual result sets.    // They may still be in use.    _resultValues.clear();    _rs = null;    Statement stmt = null;    try {      stmt = _conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,                                   ResultSet.CONCUR_READ_ONLY);      stmt.setEscapeProcessing(false); // php/1406      if (stmt.execute(sql)) {        ResultSet rs = stmt.getResultSet();        _rs = new JdbcResultResource(stmt, rs, this);        _affectedRows = 0;        _resultValues.add(_rs);        _warnings = stmt.getWarnings();      } else {        // php/4310 should return a result set        // for update statements. It is always        // null though. So keep the stmt for        // future reference (PostgresModule.pg_last_oid)        // php/1f33        if (_pgconn) {          _rs = new JdbcResultResource(stmt, null, this);          _resultValues.add(_rs);        }        _affectedRows = 0;        _affectedRows = stmt.getUpdateCount();        _rs.setAffectedRows(_affectedRows);        _warnings = stmt.getWarnings();        // for php/4310        if (!_pgconn) {          stmt.close();        }      }    } catch (DataTruncation truncationError) {      try {        _affectedRows = stmt.getUpdateCount();        _warnings = stmt.getWarnings();      } catch (SQLException e) {        _errorMessage = e.getMessage();        _errorCode = e.getErrorCode();        log.log(Level.WARNING, e.toString(), e);        return BooleanValue.FALSE;      }    } catch (SQLException e) {      _errorMessage = e.getMessage();      _errorCode = e.getErrorCode();      log.log(Level.WARNING, e.toString(), e);      return BooleanValue.FALSE;    }    if (_resultValues.size() > 0) {      _nextResultValue = 0;      _hasBeenUsed = false;      return _resultValues.get(0);    } else      return BooleanValue.TRUE;  }