public UpdateResult deepCopy() { return new UpdateResult(this); }
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(); }
case UPDATE_COUNT: if (value == null) { unsetUpdateCount(); } else { setUpdateCount((Integer)value); unsetBatchUpdateCounts(); } else { setBatchUpdateCounts((List<Integer>)value); unsetGeneratedKeys(); } else { setGeneratedKeys((RowSet)value); unsetWarnings(); } else { setWarnings((GFXDExceptionData)value);
this.warnings = ur.getWarnings(); if (this.attrs.isRequireAutoIncCols()) { this.currentGeneratedKeys = ur.getGeneratedKeys(); List<Integer> updateCounts = ur.getBatchUpdateCounts(); if (updateCounts != null) { int[] result = new int[updateCounts.size()];
if (sqls.size() == 1) { int updateCount = stmt.executeUpdate(sqls.get(0)); result = new UpdateResult(); result.setUpdateCount(updateCount); result = new UpdateResult(); for (int count : batchUpdateCounts) { result.addToBatchUpdateCounts(count); RowSet rowSet = getRowSet(stmt, null, rs, INVALID_ID, connId, attrs, 0, false, false, 0, connHolder, true, "getGeneratedKeys"); result.setGeneratedKeys(rowSet);
source.connId, source.token, ns, false, null); return new UpdateResult().setUpdateCount(sr.getUpdateCount()) .setGeneratedKeys(sr.getGeneratedKeys()) .setWarnings(sr.getWarnings()); } catch (Throwable t) { attrs.setPossibleDuplicate(false);
UpdateResult result = new UpdateResult(); result.setUpdateCount(updateCount); stmtHolder.getStatementAttrs(), 0, false, false, 0, connHolder, true, "getGeneratedKeys"); result.setGeneratedKeys(rowSet);
source.connId, source.token, ns, false, null); return new UpdateResult() .setBatchUpdateCounts(sr.getBatchUpdateCounts()) .setGeneratedKeys(sr.getGeneratedKeys()) .setWarnings(sr.getWarnings()); } catch (Throwable t) { attrs.setPossibleDuplicate(false);
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); } }
UpdateResult result = new UpdateResult(); for (int count : batchUpdateCounts) { result.addToBatchUpdateCounts(count); stmtHolder.getStatementAttrs(), 0, false, false, 0, connHolder, true, "getGeneratedKeys"); result.setGeneratedKeys(rowSet);
private final void fillWarnings(UpdateResult ur, Statement stmt) throws SQLException { SQLWarning warnings = stmt.getWarnings(); if (warnings != null) { ur.setWarnings(gfxdWarning(warnings)); } }
paramsBatch, token); sr = new StatementResult(); sr.setBatchUpdateCounts(ur.getBatchUpdateCounts()); sr.setGeneratedKeys(ur.getGeneratedKeys()); sr.setWarnings(ur.getWarnings());
if (sqls.size() == 1) { int updateCount = stmt.executeUpdate(sqls.get(0)); result = new UpdateResult(); result.setUpdateCount(updateCount); result = new UpdateResult(); for (int count : batchUpdateCounts) { result.addToBatchUpdateCounts(count); RowSet rowSet = getRowSet(stmt, null, rs, INVALID_ID, connId, attrs, 0, false, false, 0, connHolder, true, "getGeneratedKeys"); result.setGeneratedKeys(rowSet);
UpdateResult result = new UpdateResult(); result.setUpdateCount(updateCount); stmtHolder.getStatementAttrs(), 0, false, false, 0, connHolder, true, "getGeneratedKeys"); result.setGeneratedKeys(rowSet);
/** * {@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); } }
UpdateResult result = new UpdateResult(); for (int count : batchUpdateCounts) { result.addToBatchUpdateCounts(count); stmtHolder.getStatementAttrs(), 0, false, false, 0, connHolder, true, "getGeneratedKeys"); result.setGeneratedKeys(rowSet);
private final void fillWarnings(UpdateResult ur, Statement stmt) throws SQLException { SQLWarning warnings = stmt.getWarnings(); if (warnings != null) { ur.setWarnings(gfxdWarning(warnings)); } }
paramsBatch, token); sr = new StatementResult(); sr.setBatchUpdateCounts(ur.getBatchUpdateCounts()); sr.setGeneratedKeys(ur.getGeneratedKeys()); sr.setWarnings(ur.getWarnings());
UpdateResult ur = this.service.executeUpdate(batch, getAttributes()); clearPendingTransactionAttrs(); this.warnings = ur.getWarnings(); this.currentGeneratedKeys = ur.getGeneratedKeys(); List<Integer> updateCounts = ur.getBatchUpdateCounts(); if (updateCounts != null) { int[] result = new int[updateCounts.size()]; return new int[] { ur.getUpdateCount() };