public Object getFieldValue(_Fields field) { switch (field) { case UPDATE_COUNT: return Integer.valueOf(getUpdateCount()); case BATCH_UPDATE_COUNTS: return getBatchUpdateCounts(); case GENERATED_KEYS: return getGeneratedKeys(); 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 (GFXDException gfxde) { throw ThriftExceptionUtil.newSQLException(gfxde); } }
/** * {@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 (GFXDException gfxde) { throw ThriftExceptionUtil.newSQLException(gfxde); } }
sr.setBatchUpdateCounts(ur.getBatchUpdateCounts()); sr.setGeneratedKeys(ur.getGeneratedKeys()); sr.setWarnings(ur.getWarnings());
sr.setBatchUpdateCounts(ur.getBatchUpdateCounts()); sr.setGeneratedKeys(ur.getGeneratedKeys()); sr.setWarnings(ur.getWarnings());