com.pivotal.gemfirexd.internal.client.am

## Class SingleHopPreparedStatement

- java.lang.Object
- - com.pivotal.gemfirexd.internal.client.am.Statement
  - - com.pivotal.gemfirexd.internal.client.am.PreparedStatement
    - - com.pivotal.gemfirexd.internal.client.am.SingleHopPreparedStatement

All Implemented Interfaces:
  PreparedStatementCallbackInterface, StatementCallbackInterface, UnitOfWorkListener, AutoCloseable, PreparedStatement, Statement, Wrapper

Direct Known Subclasses:
  PreparedStatement40

    public abstract class SingleHopPreparedStatement
    extends PreparedStatement

This prepared statement will be returned to the user in case single hop is enabled on the connection and the query qualifies for the single hop.

### Field Summary

Fields
`com.pivotal.gemfirexd.internal.shared.common.Converter` `crossConverter`

### Fields inherited from class com.pivotal.gemfirexd.internal.client.am.PreparedStatement

`clientParamTypeAtFirstExecute, internalPreparedStatement, materialPreparedStatement_, outputRegistered_, parameterMetaData_, parameters_, pooledConnection_, singleHopInfoAlreadyFetched_, sql_, superFlowExecuteCalled_`

### Fields inherited from class com.pivotal.gemfirexd.internal.client.am.Statement

`autoGeneratedKeys_, cachedCursor_, cachedSingletonRowData_, CLOSE_ALL_RESULTS, CLOSE_CURRENT_RESULT, cursorAttributesToSendOnPrepare_, doWriteTimeout, fetchDirection_, fetchSize_, generatedKeysColumnIndexes_, generatedKeysColumnNames_, generatedKeysResultSet_, indexOfCurrentResultSet_, isCommitSql__, isPoolable, isPreparedStatement_, isQuery__, isRollbackSql__, KEEP_CURRENT_RESULT, materialStatement_, numInvisibleRS_, preparedStatementForAutoGeneratedKeys_, resultSetConcurrency_, resultSetHoldability_, resultSetType_, section_, SET_SCHEMA_STATEMENT, singletonRowData_, specialRegisterArrayList, sqlMode_, statementUUID, TIMEOUT_STATEMENT`

### Fields inherited from interface java.sql.Statement

`CLOSE_ALL_RESULTS, CLOSE_CURRENT_RESULT, EXECUTE_FAILED, KEEP_CURRENT_RESULT, NO_GENERATED_KEYS, RETURN_GENERATED_KEYS, SUCCESS_NO_INFO`

### Constructor Summary

Constructors
Constructor and Description
`SingleHopPreparedStatement(Agent agent, Connection connection, String sql, int type, int concurrency, int holdability, int autoGeneratedKeys, String[] columnNames, int[] columnIndexes, ClientPooledConnection cpc)`
`SingleHopPreparedStatement(Agent agent, Connection connection, String sql, Section section, ClientPooledConnection cpc)`

### Method Summary

Methods
`protected void` `cleanSingleHopPrepStmnt()`
`void` `createNewSetForTesting()`
`boolean` `execute()`
`ResultSet` `executeQuery()`
`int` `executeUpdate()`
`protected void` `flowExecute(int executeType, int currExecSeq)`
`ResultSet` `getResultSet()`
`Set` `getRoutingObjectSet()`
`NetResultSet` `getSuperResultSet()`
`void` `initialize(Section sec)`
`static String` `returnParameters(Object[] parameters)`
`void` `setRoutingObjectSetToNull()`
`protected ResultSet` `singleHopPrepStmntExecuteQuery()`
`static void` `sleepForRetry(Connection connection_)`
`boolean` `wasSingleHopCalledInExecution()`

### Methods inherited from class com.pivotal.gemfirexd.internal.client.am.PreparedStatement

`addBatch, clearParameters, completeDescribeInput, completeDescribeOutput, completeLocalCommit, completeLocalRollback, execute, execute, execute, execute, executeBatch, executeBatchX, executeQuery, executeUpdate, executeUpdate, executeUpdate, executeUpdate, flowExecuteRead, flowExecuteWrite, getClientParamType, getJdbcStatementInterfaceName, getMetaData, getParameterMetaData, initResetPreparedStatement, listenToUnitOfWork, makeNewClientParamTypeFrom, markClosed, readDescribeInput, readDescribeOutput, readExecute, reset, resetPreparedStatement, resetPreparedStatement, resetPreparedStatement, setAndStoreClientParamType, setArray, setAsciiStream, setAsciiStream, setAsciiStream, setBigDecimal, setBinaryStream, setBinaryStream, setBinaryStream, setBinaryStreamX, setBlob, setBlob, setBlob, setBlobX, setBoolean, setByte, setBytes, setBytesX, setCharacterStream, setCharacterStream, setCharacterStream, setClob, setClob, setClob, setDate, setDate, setDouble, setFloat, setInt, setLong, setNull, setNull, setObject, setObject, setObject, setRef, setShort, setString, setTime, setTime, setTimestamp, setTimestamp, setUnicodeStream, setURL, writeDescribeInput, writeDescribeOutput, writeExecute`

### Methods inherited from class com.pivotal.gemfirexd.internal.client.am.Statement

`accumulateWarning, addBatch, cancel, checkForDuplicateCursorName, checkForStoredProcResultSetCount, clearBatch, clearWarnings, close, closeX, completeExecute, completeExecuteCall, completeExecuteCall, completeExecuteCallOpenQuery, completeExecuteImmediate, completeExecuteSetStatement, completeOpenQuery, completePrepare, completePrepareDescribeOutput, completeSqlca, completeStatementIDRead, finalize, getConnection, getConnectionCallbackInterface, getFetchDirection, getFetchSize, getGeneratedKeys, getGuessedResultSetMetaData, getMaxFieldSize, getMaxRows, getMoreResults, getMoreResults, getQueryTimeout, getResultSetConcurrency, getResultSetHoldability, getResultSetType, getSection, getSqlWarnings, getUpdateCount, getWarnings, initResetPreparedStatement, isCallMode, isClosed, isClosedNoThrow, isPoolable, isQueryMode, isWrapperFor, jdbc3FeatureNotSupported, jdbc3FeatureNotSupported, markAutoCommitted, needStatementUUID, readExecuteCall, readExecuteImmediate, readExecuteImmediateForBatch, readOpenQuery, readPrepare, readPrepareDescribeOutput, readSetSpecialRegister, readStatementID, removeClientCursorNameFromCache, resetStatement, resetStatement, resultSetCommitting, resultSetCommitting, setCursorName, setEscapeProcessing, setFetchDirection, setFetchSize, setMaxFieldSize, setMaxRows, setOwner, setPoolable, setQueryTimeout, setupCursorNameCacheAndMappings, setUpdateCount, substituteClientCursorNameWithServerCursorName, upperCaseProcedureName, writeExecuteCall, writeExecuteImmediate, writeGetStmtUUID, writeOpenQuery, writePrepare, writePrepareDescribeOutput, writeSetSpecialRegister`

### Methods inherited from class java.lang.Object

`clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface java.sql.PreparedStatement

`setNCharacterStream, setNCharacterStream, setNClob, setNClob, setNClob, setNString, setRowId, setSQLXML`

### Methods inherited from interface java.sql.Statement

`addBatch, cancel, clearBatch, clearWarnings, close, closeOnCompletion, getConnection, getFetchDirection, getFetchSize, getGeneratedKeys, getMaxFieldSize, getMaxRows, getMoreResults, getMoreResults, getQueryTimeout, getResultSetConcurrency, getResultSetHoldability, getResultSetType, getUpdateCount, getWarnings, isClosed, isCloseOnCompletion, isPoolable, setCursorName, setEscapeProcessing, setFetchDirection, setFetchSize, setMaxFieldSize, setMaxRows, setPoolable, setQueryTimeout`

### Methods inherited from interface java.sql.Wrapper

`isWrapperFor, unwrap`

### Methods inherited from interface com.pivotal.gemfirexd.internal.client.am.StatementCallbackInterface

`accumulateWarning, completeExecute, completeExecuteCall, completeExecuteCall, completeExecuteCallOpenQuery, completeExecuteImmediate, completeExecuteSetStatement, completeOpenQuery, completePrepare, completePrepareDescribeOutput, completeSqlca, completeStatementIDRead, getConnectionCallbackInterface, getGuessedResultSetMetaData, getSection`

### Field Detail

#### crossConverter

    public final com.pivotal.gemfirexd.internal.shared.common.Converter crossConverter

### Constructor Detail

#### SingleHopPreparedStatement

    public SingleHopPreparedStatement(Agent agent,
                              Connection connection,
                              String sql,
                              Section section,
                              ClientPooledConnection cpc)
                               throws SqlException

Throws:
  `SqlException`

#### SingleHopPreparedStatement

    public SingleHopPreparedStatement(Agent agent,
                              Connection connection,
                              String sql,
                              int type,
                              int concurrency,
                              int holdability,
                              int autoGeneratedKeys,
                              String[] columnNames,
                              int[] columnIndexes,
                              ClientPooledConnection cpc)
                               throws SqlException

Throws:
  `SqlException`

### Method Detail

#### initialize

    public void initialize(Section sec)
                    throws SQLException

Throws:
  `SQLException`

#### executeUpdate

    public int executeUpdate()
                      throws SQLException

Specified by:
  `executeUpdate` in interface `PreparedStatement`
Overrides:
  `executeUpdate` in class `PreparedStatement`
Throws:
  `SQLException`

#### singleHopPrepStmntExecuteQuery

    protected ResultSet singleHopPrepStmntExecuteQuery()
                                                throws SQLException

Overrides:
  `singleHopPrepStmntExecuteQuery` in class `PreparedStatement`
Throws:
  `SQLException`

#### returnParameters

    public static String returnParameters(Object[] parameters)

#### executeQuery

    public ResultSet executeQuery()
                           throws SQLException

Specified by:
  `executeQuery` in interface `PreparedStatement`
Overrides:
  `executeQuery` in class `PreparedStatement`
Throws:
  `SQLException`

#### execute

    public boolean execute()
                    throws SQLException

Specified by:
  `execute` in interface `PreparedStatement`
Overrides:
  `execute` in class `PreparedStatement`
Throws:
  `SQLException`

#### flowExecute

    protected void flowExecute(int executeType,
                   int currExecSeq)
                        throws SqlException

Overrides:
  `flowExecute` in class `PreparedStatement`
Throws:
  `SqlException`

#### sleepForRetry

    public static void sleepForRetry(Connection connection_)
                              throws SqlException

Throws:
  `SqlException`

#### cleanSingleHopPrepStmnt

    protected void cleanSingleHopPrepStmnt()
                                    throws SqlException

Overrides:
  `cleanSingleHopPrepStmnt` in class `Statement`
Throws:
  `SqlException`

#### getRoutingObjectSet

    public Set getRoutingObjectSet()

#### createNewSetForTesting

    public void createNewSetForTesting()

#### setRoutingObjectSetToNull

    public void setRoutingObjectSetToNull()

#### wasSingleHopCalledInExecution

    public boolean wasSingleHopCalledInExecution()

#### getResultSet

    public ResultSet getResultSet()
                           throws SQLException

Specified by:
  `getResultSet` in interface `Statement`
Overrides:
  `getResultSet` in class `Statement`
Throws:
  `SQLException`

#### getSuperResultSet

    public NetResultSet getSuperResultSet()
                                   throws SQLException

Overrides:
  `getSuperResultSet` in class `PreparedStatement`
Throws:
  `SQLException`