public Object getFieldValue(_Fields field) { switch (field) { case RESULT_SET_TYPE: return Byte.valueOf(getResultSetType()); return Boolean.valueOf(isUpdatable()); return Boolean.valueOf(isHoldCursorsOverCommit()); return Boolean.valueOf(isRequireAutoIncCols()); return getAutoIncColumns(); return getAutoIncColumnNames(); return Integer.valueOf(getBatchSize()); return Boolean.valueOf(isFetchReverse()); return Integer.valueOf(getLobChunkSize()); return Integer.valueOf(getMaxRows()); return Integer.valueOf(getMaxFieldSize()); return Integer.valueOf(getTimeout()); return getCursorName(); return Boolean.valueOf(isPossibleDuplicate());
return isSetResultSetType(); case UPDATABLE: return isSetUpdatable(); case HOLD_CURSORS_OVER_COMMIT: return isSetHoldCursorsOverCommit(); case REQUIRE_AUTO_INC_COLS: return isSetRequireAutoIncCols(); case AUTO_INC_COLUMNS: return isSetAutoIncColumns(); case AUTO_INC_COLUMN_NAMES: return isSetAutoIncColumnNames(); case BATCH_SIZE: return isSetBatchSize(); case FETCH_REVERSE: return isSetFetchReverse(); case LOB_CHUNK_SIZE: return isSetLobChunkSize(); case MAX_ROWS: return isSetMaxRows(); case MAX_FIELD_SIZE: return isSetMaxFieldSize(); case TIMEOUT: return isSetTimeout(); case CURSOR_NAME: return isSetCursorName(); case POSSIBLE_DUPLICATE: return isSetPossibleDuplicate(); case POOLABLE: return isSetPoolable();
/** * {@inheritDoc} */ @Override public int getResultSetConcurrency() throws SQLException { return this.attrs.isSetUpdatable() && this.attrs.isUpdatable() ? ResultSet.CONCUR_UPDATABLE : ResultSet.CONCUR_READ_ONLY; }
/** * Returns the Holdability associated with the statement if set the the input * object if not set by default returns #ResultS * * @param attrs * @return */ static int getResultSetHoldability(StatementAttrs attrs) { return attrs != null && attrs.isSetHoldCursorsOverCommit() && attrs.isHoldCursorsOverCommit() ? ResultSet.HOLD_CURSORS_OVER_COMMIT : ResultSet.CLOSE_CURSORS_AT_COMMIT; }
/** * {@inheritDoc} */ @Override public int getResultSetType() throws SQLException { if (this.attrs.isSetResultSetType()) { return Converters.getJdbcResultSetType(this.attrs.getResultSetType()); } else { return ResultSet.TYPE_FORWARD_ONLY; } }
protected final void setAutoIncAttributes(boolean getAutoInc, int[] autoIncColumns, String[] autoIncColumnNames) { if (getAutoInc) { this.attrs.setRequireAutoIncCols(true); } else if (this.attrs.isSetRequireAutoIncCols()) { this.attrs.setRequireAutoIncCols(false); this.attrs.setRequireAutoIncColsIsSet(false); } if (autoIncColumns != null) { this.attrs.setAutoIncColumns(getIntegerList(autoIncColumns)); } else { this.attrs.setAutoIncColumns(null); } if (autoIncColumnNames != null) { this.attrs.setAutoIncColumnNames(Arrays.asList(autoIncColumnNames)); } else { this.attrs.setAutoIncColumnNames(null); } }
final void clearPendingTransactionAttrs() { Map<TransactionAttribute, Boolean> txFlags = this.attrs .getPendingTransactionAttrs(); if (txFlags != null) { this.conn.lock(); try { // It is possible that other statements created off the same connection // flushed the pending TransactionAttribute flags and/or new flags got // added after this statement creation, so go through each flag and // flush only the matching flags with same flushed values for (Map.Entry<TransactionAttribute, Boolean> e : txFlags.entrySet()) { TransactionAttribute txFlag = e.getKey(); boolean isSet = e.getValue().booleanValue(); if (isSet == this.service.isTXFlagSet(txFlag, !isSet)) { this.conn.pendingTXFlags.remove(txFlag); } } } finally { this.conn.unlock(); } this.attrs.setPendingTransactionAttrs(null); } }
/** * {@inheritDoc} */ @Override public int getFetchSize() { return this.attrs.isSetBatchSize() ? this.attrs.batchSize : gfxdConstants.DEFAULT_RESULTSET_BATCHSIZE; }
.setTotalLength(length); final int chunkSize; if (attrs != null && attrs.isSetLobChunkSize()) { chunkSize = attrs.lobChunkSize;
private boolean processPendingTransactionAttributes(StatementAttrs attrs, EmbedConnection conn) throws GFXDException { if (attrs == null) { return false; } Map<TransactionAttribute, Boolean> pendingTXAttrs = attrs .getPendingTransactionAttrs(); if (pendingTXAttrs != null && !pendingTXAttrs.isEmpty()) { beginOrAlterTransaction(conn, gfxdConstants.TRANSACTION_NO_CHANGE, pendingTXAttrs, false); } if (attrs.possibleDuplicate) { conn.setPossibleDuplicate(true); return true; } else { return false; } }
final int resultSetConcurrency = getResultSetConcurrency(attrs); final int resultSetHoldability = getResultSetHoldability(attrs); if (attrs != null && attrs.isSetRequireAutoIncCols() && attrs.requireAutoIncCols) { if (outputParams != null && !outputParams.isEmpty()) {
/** * Returns the Concurrency associated with the statement if set the the input * object if not set by default returns java.sql.ResultSet.CONCUR_READ_ONLY * * @param attrs * @return */ static int getResultSetConcurrency(StatementAttrs attrs) { return attrs != null && attrs.isSetUpdatable() && attrs.isUpdatable() ? ResultSet.CONCUR_UPDATABLE : ResultSet.CONCUR_READ_ONLY; }
/** * Returns the Holdability associated with the statement if set the the input * object if not set by default returns #ResultS * * @param attrs * @return */ static int getResultSetHoldability(StatementAttrs attrs) { return attrs != null && attrs.isSetHoldCursorsOverCommit() && attrs.isHoldCursorsOverCommit() ? ResultSet.HOLD_CURSORS_OVER_COMMIT : ResultSet.CLOSE_CURSORS_AT_COMMIT; }
/** * Returns the resultType if set if not set returns the default * java.sql.ResultSet.TYPE_FORWARD_ONLY */ static int getResultType(StatementAttrs attrs) { int rsType; if (attrs != null && attrs.isSetResultSetType()) { rsType = attrs.getResultSetType(); } else { rsType = gfxdConstants.DEFAULT_RESULTSET_TYPE; } switch (rsType) { case gfxdConstants.RESULTSET_TYPE_FORWARD_ONLY: return ResultSet.TYPE_FORWARD_ONLY; case gfxdConstants.RESULTSET_TYPE_INSENSITIVE: return ResultSet.TYPE_SCROLL_INSENSITIVE; case gfxdConstants.RESULTSET_TYPE_SENSITIVE: return ResultSet.TYPE_SCROLL_SENSITIVE; default: throw new InternalGemFireError("unknown resultSet type " + attrs.getResultSetType()); } }
batchSize = fetchSize; else if (attrs != null && attrs.isSetBatchSize()) { batchSize = attrs.batchSize;
if (attrs != null && attrs.isSetLobChunkSize()) { chunkSize = attrs.lobChunkSize;
private boolean processPendingTransactionAttributes(StatementAttrs attrs, EmbedConnection conn) throws GFXDException { if (attrs == null) { return false; } Map<TransactionAttribute, Boolean> pendingTXAttrs = attrs .getPendingTransactionAttrs(); if (pendingTXAttrs != null && !pendingTXAttrs.isEmpty()) { beginOrAlterTransaction(conn, gfxdConstants.TRANSACTION_NO_CHANGE, pendingTXAttrs, false); } if (attrs.possibleDuplicate) { conn.setPossibleDuplicate(true); return true; } else { return false; } }
final int resultSetConcurrency = getResultSetConcurrency(attrs); final int resultSetHoldability = getResultSetHoldability(attrs); if (attrs != null && attrs.isSetRequireAutoIncCols() && attrs.requireAutoIncCols) { if (outputParams != null && !outputParams.isEmpty()) {
boolean this_present_resultSetType = true && this.isSetResultSetType(); boolean that_present_resultSetType = true && that.isSetResultSetType(); if (this_present_resultSetType || that_present_resultSetType) { if (!(this_present_resultSetType && that_present_resultSetType)) boolean this_present_updatable = true && this.isSetUpdatable(); boolean that_present_updatable = true && that.isSetUpdatable(); if (this_present_updatable || that_present_updatable) { if (!(this_present_updatable && that_present_updatable)) boolean this_present_holdCursorsOverCommit = true && this.isSetHoldCursorsOverCommit(); boolean that_present_holdCursorsOverCommit = true && that.isSetHoldCursorsOverCommit(); if (this_present_holdCursorsOverCommit || that_present_holdCursorsOverCommit) { if (!(this_present_holdCursorsOverCommit && that_present_holdCursorsOverCommit)) boolean this_present_requireAutoIncCols = true && this.isSetRequireAutoIncCols(); boolean that_present_requireAutoIncCols = true && that.isSetRequireAutoIncCols(); if (this_present_requireAutoIncCols || that_present_requireAutoIncCols) { if (!(this_present_requireAutoIncCols && that_present_requireAutoIncCols)) boolean this_present_autoIncColumns = true && this.isSetAutoIncColumns(); boolean that_present_autoIncColumns = true && that.isSetAutoIncColumns(); if (this_present_autoIncColumns || that_present_autoIncColumns) { if (!(this_present_autoIncColumns && that_present_autoIncColumns)) boolean this_present_autoIncColumnNames = true && this.isSetAutoIncColumnNames(); boolean that_present_autoIncColumnNames = true && that.isSetAutoIncColumnNames(); if (this_present_autoIncColumnNames || that_present_autoIncColumnNames) { if (!(this_present_autoIncColumnNames && that_present_autoIncColumnNames))
/** * Returns the Concurrency associated with the statement if set the the input * object if not set by default returns java.sql.ResultSet.CONCUR_READ_ONLY * * @param attrs * @return */ static int getResultSetConcurrency(StatementAttrs attrs) { return attrs != null && attrs.isSetUpdatable() && attrs.isUpdatable() ? ResultSet.CONCUR_UPDATABLE : ResultSet.CONCUR_READ_ONLY; }