public Object getFieldValue(_Fields field) { switch (field) { case UPDATE_COUNT: return getUpdateCount(); case BATCH_UPDATE_COUNTS: return getBatchUpdateCounts(); case GENERATED_KEYS: return getGeneratedKeys(); case NEW_DEFAULT_SCHEMA: return getNewDefaultSchema(); case WARNINGS: return getWarnings(); } throw new IllegalStateException(); }
UpdateResult ur = this.service.executeUpdate(batch, getAttributes()); clearPendingTransactionAttrs(); this.warnings = ur.getWarnings(); this.currentGeneratedKeys = ur.getGeneratedKeys(); List<Integer> updateCounts = ur.getBatchUpdateCounts();
this.warnings = ur.getWarnings(); if (this.attrs.isRequireAutoIncCols()) { this.currentGeneratedKeys = ur.getGeneratedKeys();
protected int executeUpdate(String sql, boolean getAutoInc, int[] autoIncColumns, String[] autoIncColumnNames) throws SQLException { checkClosed(); reset(); setAutoIncAttributes(getAutoInc, autoIncColumns, autoIncColumnNames); try { UpdateResult ur = this.service.executeUpdate( Collections.singletonList(sql), getAttributes()); clearPendingTransactionAttrs(); if (getAutoInc) { this.currentGeneratedKeys = ur.getGeneratedKeys(); } this.warnings = ur.getWarnings(); return (this.currentUpdateCount = ur.getUpdateCount()); } catch (SnappyException se) { throw ThriftExceptionUtil.newSQLException(se); } }
/** * {@inheritDoc} */ @Override public int executeUpdate() throws SQLException { checkClosed(); reset(); try { // don't throw exception in getLobSource rather return null and // service will failover to new node and do re-prepare as required UpdateResult ur = this.service.executePreparedUpdate(getLobSource( false, "executeUpdate"), statementId, this.paramsList, this); if (this.attrs.isRequireAutoIncCols()) { this.currentGeneratedKeys = ur.getGeneratedKeys(); } this.warnings = ur.getWarnings(); return (this.currentUpdateCount = ur.getUpdateCount()); } catch (SnappyException se) { throw informListeners(ThriftExceptionUtil.newSQLException(se)); } }
sr.setGeneratedKeys(ur.getGeneratedKeys()); sr.setNewDefaultSchema(ur.getNewDefaultSchema()); sr.setWarnings(ur.getWarnings());