com.pivotal.gemfirexd.internal.client.am

## Class Connection

- java.lang.Object
- - com.pivotal.gemfirexd.internal.client.am.Connection

All Implemented Interfaces:
  ConnectionCallbackInterface, AutoCloseable, Connection, Wrapper

Direct Known Subclasses:
  NetConnection

    public abstract class Connection
    extends Object
    implements Connection, ConnectionCallbackInterface

### Nested Class Summary

Nested Classes
`static class` `Connection.FailoverStatus` Return status of `Connection#doFailoverOnException(String, int)` method.

### Field Summary

Fields
`Agent` `agent_`
`protected String` `alternateNetServers_` Any alternative locators/servers that have been provided via the property "secondary-locators=<host>[<port>],...".
`boolean` `autoCommit_`
`int` `clientSSLMode_`
`int` `commBufferSize_`
`String` `currentSchemaName_` Cached copy of the schema name.
`TxID` `currTXID`
`DatabaseMetaData` `databaseMetaData_`
`String` `databaseName_`
`ClientBaseDataSource` `dataSource_`
`static int` `DEFAULT_LOGIN_TIMEOUT` Maximum timeout in seconds for read before failover in case nothing is specified.
`static int` `DEFAULT_SINGLE_HOP_MAX_CONN_PER_SERVER`
`protected int` `defaultIsolation_` The default isolation level, enforced on connection resets.
`protected boolean` `disableCancel_` If true, then `Statement.cancel()` thru thin driver will not be supported.
`boolean` `disableStreaming_` Flag to indicate that server side streaming of data is disabled.
`boolean` `disableTXBatching_` Flag to disable all batching in transactions, flushing ops immediately to detect conflicts immediately.
`int` `dncGeneratedSavepointId_`
`static String` `dncGeneratedSavepointNamePrefix__`
`protected String` `doSetSchema_` Constant indicating that isolation_ has not been updated through piggy-backing, (or that the previously stored value was invalidated, e.g.
`protected EncryptionManager` `encryptionManager_`
`int` `executionSequence`
`static int` `INFINITE_LOGIN_TIMEOUT` Special token to indicate infinite login timeout using the DriverManager.setLoginTimeout() API.
`protected boolean` `inUnitOfWork_`
`protected int` `isolation_` Cached copy of the isolation level.
`protected boolean` `isXAConnection_`
`protected boolean` `jdbcReadOnly_`
`int` `keepAliveCnt_`
`int` `keepAliveIdle_`
`int` `keepAliveIntvl_`
`protected boolean` `loadBalance_` If false then don't attempt load-balancing for this connection, else the default is to do load-balancing.
`protected CallableLocatorProcedures` `lobProcs` Reference to object with prepared statements for calling the locator procedures.
`int` `loginTimeout_`
`int` `ncjBatchSize_` NCJ Batch Size
`int` `ncjCacheSize_` NCJ Cache Size
`int` `portNumber_`
`int` `prevSuccessfulSeq`
`String` `productID_`
`boolean` `queryHDFS_` Flag to indicate the server side queries HDFS data
`boolean` `resetConnectionAtFirstSql_`
`boolean` `retrieveMessageText_`
`protected int` `serverModifyLevel_`
`String` `serverNameIP_`
`protected int` `serverReleaseLevel_`
`com.gemstone.gemfire.internal.shared.Version` `serverVersion`
`protected int` `serverVersionLevel_`
`static int` `SINGLE_HOP_MAX_CONN_PER_SERVER`
`int` `singleHopAttempted` counter for testing to see how many single hops were actually done.
`protected boolean` `singleHopEnabled_` If false then don't attempt fetching single hop information from the server.
`boolean` `skipConstraints_` Flag to indicate that transactions on this connection should use "waiting mode" instead of "fail-fast conflict" detection.
`boolean` `skipListeners_` Flag to indicate the server side skip listeners property .
`protected boolean` `skipLocks_` if true then all DD and table locks are skipped for this connection
`int` `successfulExecutionSequence`
`boolean` `syncCommits_` Flag to indicate that transactions on this connection should sync all commits before returning (i.e.
`protected static int` `TRANSACTION_UNKNOWN`
`boolean` `useBoundedQueuePool_`
`protected String` `user_`
`static int` `XA_T0_NOT_ASSOCIATED` `XA_T0_NOT_ASSOCIATED` This connection is not currently associated with an XA transaction In this state commits will flow in autocommit mode.
`static int` `XA_T1_ASSOCIATED` `XA_T1_ASSOCIATED` In this state commits will not flow in autocommit mode.
`int` `xaHostVersion_`

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

`TRANSACTION_NONE, TRANSACTION_READ_COMMITTED, TRANSACTION_READ_UNCOMMITTED, TRANSACTION_REPEATABLE_READ, TRANSACTION_SERIALIZABLE`

### Constructor Summary

Constructors
`protected` `Connection(LogWriter logWriter, boolean isXAConn, ClientBaseDataSource dataSource)`
`protected` `Connection(LogWriter logWriter, int driverManagerLoginTimeout, String serverName, int portNumber, String databaseName, Properties properties)`
`protected` `Connection(LogWriter logWriter, String user, String password, boolean isXAConn, ClientBaseDataSource dataSource)`
`protected` `Connection(LogWriter logWriter, String user, String password, ClientBaseDataSource dataSource)`

### Method Summary

Methods
`void` `accumulate440WarningForMessageProcFailure(SqlWarning e)`
`void` `accumulate444WarningForMessageProcFailure(SqlWarning e)`
`void` `accumulateWarning(SqlWarning e)`
`abstract void` `addSpecialRegisters(String s)`
`protected abstract boolean` `allowCloseInUOW_()`
`protected abstract boolean` `allowLocalCommitRollback_()`
`boolean` `cancelDisabled()`
`protected void` `checkForClosedConnection()`
`void` `clearWarnings()`
`void` `clearWarningsX()`
`void` `close()`
`void` `closeForReuse(boolean statementPooling)`
`void` `closeResources()`
`void` `closeX()`
`void` `commit()`
`void` `completeAbnormalUnitOfWork()`
`void` `completeAbnormalUnitOfWork(UnitOfWorkListener uwl)` Rollback the UnitOfWorkListener specifically.
`void` `completeChainBreakingDisconnect()`
`void` `completeConnect()`
`void` `completeInitialPiggyBackIsolation(int pbIsolation)` Sets the default isolation level of the connection upon connection initialization.
`void` `completeInitialPiggyBackSchema(String pbSchema)` Sets the current schema upon connection initialization.
`void` `completeLocalCommit()`
`void` `completeLocalRollback()`
`void` `completePiggyBackIsolation(int pbIsolation)` Completes piggy-backing of the new current isolation level by updating the cached copy in am.Connection.
`void` `completePiggyBackSchema(String pbSchema)` Completes piggy-backing of the new current schema by updating the cached copy in am.Connection.
`protected void` `completeReset(boolean isDeferredReset, boolean closeStatementsOnClose, boolean fullReset)`
`protected void` `completeReset(boolean isDeferredReset, boolean closeStatementsOnClose, NetXAResource xares)` NOTE:The following comments are valid for the changes done as part of implementing statement caching only (see DERBY-3313 and linked issues).
`void` `completeServerVersion(int majorVersion)`
`void` `completeSpecificRollback(UnitOfWorkListener uwl)` Rollback the specific UnitOfWorkListener.
`void` `completeSqlca(Sqlca sqlca)`
`Blob` `createBlob()`
`Clob` `createClob()` Constructs an object that implements the `Clob` interface.
`Statement` `createStatement()`
`Statement` `createStatement(int resultSetType, int resultSetConcurrency)`
`Statement` `createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability)`
`protected abstract boolean` `doCloseStatementsOnClose_()`
`abstract Connection.FailoverStatus` `doFailoverOnException(String sqlState, int errorCode, Exception thrownEx)`
`protected void` `finalize()`
`boolean` `flowAutoCommit()`
`void` `flowCommit()`
`protected void` `flowRollback()`
`boolean` `getAutoCommit()`
`String` `getCatalog()`
`abstract Properties` `getConnectionProperties()`
`String` `getCurrentSchemaName()` Returns the current schema (the schema that would be used for compilation.
`int` `getHoldability()`
`abstract InputStream` `getInputStream()`
`DatabaseMetaData` `getMetaData()`
`abstract OutputStream` `getOutputStream()`
`abstract String` `getServerLocation()`
`int` `getServerVersion()`
`int` `getTransactionID()` Returns the ID of the active transaction for this connection.
`int` `getTransactionIsolation()`
`int` `getTransactionIsolationX()`
`Map` `getTypeMap()`
`SQLWarning` `getWarnings()`
`int` `getXAState()`
`abstract Set` `handleFailover(Set failedUrls, SqlException ex)`
`int` `incrementAndGetExecutionSequence()`
`static void` `init()`
`protected void` `initConnection(LogWriter logWriter, String password, ClientBaseDataSource dataSource)`
`static void` `initialize()`
`boolean` `isClosed()`
`boolean` `isClosedX()`
`protected abstract boolean` `isGlobalPending_()`
`boolean` `isOpen()` Returns if a transaction is in process
`boolean` `isPhysicalConnClosed()` Return true if the physical connection is still open.
`boolean` `isReadOnly()`
`boolean` `isSingleHopEnabled()` Constructs an object that implements the `Blob` interface.
`boolean` `isXAConnection()`
`void` `lightReset()`
`protected CallableLocatorProcedures` `locatorProcedureCall()` Get handle to the object that contains prepared statements for calling locator procedures for this connection.
`protected abstract void` `markClosed_()`
`protected void` `markClosed()`
`void` `markClosed(boolean statementPooling)`
`protected void` `markOpen(String method)`
`String` `nativeSQL(String sql)`
`String` `nativeSQLX(String sql)`
`protected abstract Agent` `newAgent_(LogWriter logWriter, int loginTimeout, String serverName, int portNumber, int clientSSLMode, Properties properties)`
`protected abstract CallableStatement` `newCallableStatement_(String sql, int type, int concurrency, int holdability)`
`protected abstract DatabaseMetaData` `newDatabaseMetaData_()`
`protected abstract PreparedStatement` `newPositionedUpdatePreparedStatement_(String sql, Section section)`
`protected abstract PreparedStatement` `newPreparedStatement_(String sql, int type, int concurrency, int holdability, int autoGeneratedKeys, String[] columnNames, int[] columnIndexes)`
`abstract SectionManager` `newSectionManager(String collection, Agent agent, String databaseName)`
`protected abstract Statement` `newStatement_(int type, int concurrency, int holdability)`
`protected abstract void` `preAgentInitialize(String password, ClientBaseDataSource dataSource, Properties properties)`
`CallableStatement` `prepareCall(String sql)`
`CallableStatement` `prepareCall(String sql, int resultSetType, int resultSetConcurrency)`
`CallableStatement` `prepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability)`
`CallableStatement` `prepareMessageProc(String sql)`
`PreparedStatement` `preparePositionedUpdateStatement(String sql, Section querySection)`
`PreparedStatement` `prepareStatement(String sql)`
`PreparedStatement` `prepareStatement(String sql, int autoGeneratedKeys)`
`PreparedStatement` `prepareStatement(String sql, int[] columnIndexes)`
`PreparedStatement` `prepareStatement(String sql, int resultSetType, int resultSetConcurrency)`
`PreparedStatement` `prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability)`
`PreparedStatement` `prepareStatement(String sql, String[] columnNames)`
`void` `readCommit()`
`abstract void` `readCommitSubstitute_()`
`abstract void` `readLocalCommit_()`
`abstract void` `readLocalRollback_()`
`abstract void` `readLocalXACommit_()`
`abstract void` `readLocalXARollback_()`
`abstract void` `readLocalXAStart_()`
`void` `readRollback()`
`void` `readTransactionStart()`
`protected abstract void` `readXACommit_()`
`protected abstract void` `readXARollback_()`
`void` `releaseSavepoint(Savepoint savepoint)`
`protected abstract void` `reset_(LogWriter logWriter)`
`void` `reset(LogWriter logWriter)`
`protected abstract void` `resetCallableStatement_(CallableStatement cs, String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability)`
`protected void` `resetConnection(LogWriter logWriter)`
`protected void` `resetPrepareCall(CallableStatement cs)`
`protected abstract void` `resetPreparedStatement_(PreparedStatement ps, String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability, int autoGeneratedKeys, String[] columnNames, int[] columnIndexes)`
`protected void` `resetPrepareStatement(PreparedStatement ps)`
`protected abstract void` `resetStatement_(Statement statement, int type, int concurrency, int holdability)`
`protected void` `resetStatement(Statement s)`
`void` `rollback()`
`void` `rollback(Savepoint savepoint)`
`protected abstract boolean` `serverSupportsLocators()` Checks whether the server supports locators for large objects.
`void` `setAutoCommit(boolean autoCommit)`
`protected void` `setAutoCommitX(boolean autoCommit)`
`void` `setCatalog(String catalog)`
`void` `setHoldability(int holdability)`
`void` `setInUnitOfWork(boolean inUnitOfWork)`
`void` `setReadOnly(boolean readOnly)`
`Savepoint` `setSavepoint()`
`Savepoint` `setSavepoint(String name)`
`void` `setTransactionIsolation(int level)`
`protected void` `setTransactionIsolationX(int level)` Set the transaction isolation level as specified.
`void` `setTypeMap(Map map)`
`void` `setXAState(int state)`
`protected abstract boolean` `supportsSessionDataCaching()` Finds out if the underlaying database connection supports session data caching.
`boolean` `transactionInProgress()` Check if there are uncommitted operations in the current transaction that prevent us from closing the connection.
`boolean` `willAutoCommitGenerateFlow()`
`void` `writeCommit()`
`abstract void` `writeCommitSubstitute_()`
`abstract void` `writeLocalCommit_()`
`abstract void` `writeLocalRollback_()`
`abstract void` `writeLocalXACommit_()`
`abstract void` `writeLocalXARollback_()`
`abstract void` `writeLocalXAStart_()`
`void` `writeRollback()`
`void` `writeTransactionStart(Statement statement)`
`protected abstract void` `writeXACommit_()`
`protected abstract void` `writeXARollback_()`
`protected abstract void` `writeXATransactionStart(Statement statement)`

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

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

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

`abort, createArrayOf, createNClob, createSQLXML, createStruct, getClientInfo, getClientInfo, getNetworkTimeout, getSchema, isValid, setClientInfo, setClientInfo, setNetworkTimeout, setSchema`

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

`isWrapperFor, unwrap`

### Field Detail

#### agent_

    public Agent agent_

#### databaseMetaData_

    public DatabaseMetaData databaseMetaData_

#### user_

    protected final String user_

#### retrieveMessageText_

    public boolean retrieveMessageText_

#### jdbcReadOnly_

    protected boolean jdbcReadOnly_

#### databaseName_

    public String databaseName_

#### productID_

    public String productID_

#### serverVersionLevel_

    protected int serverVersionLevel_

#### serverReleaseLevel_

    protected int serverReleaseLevel_

#### serverModifyLevel_

    protected int serverModifyLevel_

#### encryptionManager_

    protected EncryptionManager encryptionManager_

#### doSetSchema_

    protected String doSetSchema_

Constant indicating that isolation_ has not been updated through piggy-backing, (or that the previously stored value was invalidated, e.g. by an XA state change).

#### TRANSACTION_UNKNOWN

    protected static final int TRANSACTION_UNKNOWN

See Also:
  Constant Field Values

#### isolation_

    protected int isolation_

Cached copy of the isolation level. Kept in sync with server through piggy-backing.

#### defaultIsolation_

    protected int defaultIsolation_

The default isolation level, enforced on connection resets.

Note that this value may be changed upon connection initialization in the future, as the server can piggy-back the isolation level.

#### currentSchemaName_

    public String currentSchemaName_

Cached copy of the schema name. Updated through piggy-backing and used to implement statement caching.

#### autoCommit_

    public boolean autoCommit_

#### executionSequence

    public int executionSequence

#### successfulExecutionSequence

    public int successfulExecutionSequence

#### prevSuccessfulSeq

    public int prevSuccessfulSeq

#### currTXID

    public TxID currTXID

#### serverVersion

    public com.gemstone.gemfire.internal.shared.Version serverVersion

#### inUnitOfWork_

    protected boolean inUnitOfWork_

#### isXAConnection_

    protected boolean isXAConnection_

#### XA_T0_NOT_ASSOCIATED

    public static final int XA_T0_NOT_ASSOCIATED

`XA_T0_NOT_ASSOCIATED` This connection is not currently associated with an XA transaction In this state commits will flow in autocommit mode.

See Also:
  Constant Field Values

#### XA_T1_ASSOCIATED

    public static final int XA_T1_ASSOCIATED

`XA_T1_ASSOCIATED` In this state commits will not flow in autocommit mode.

See Also:
  Constant Field Values

#### xaHostVersion_

    public int xaHostVersion_

#### loginTimeout_

    public int loginTimeout_

#### dataSource_

    public ClientBaseDataSource dataSource_

#### serverNameIP_

    public String serverNameIP_

#### portNumber_

    public int portNumber_

#### clientSSLMode_

    public int clientSSLMode_

#### commBufferSize_

    public int commBufferSize_

#### resetConnectionAtFirstSql_

    public boolean resetConnectionAtFirstSql_

#### loadBalance_

    protected boolean loadBalance_

If false then don't attempt load-balancing for this connection, else the default is to do load-balancing.

#### alternateNetServers_

    protected String alternateNetServers_

Any alternative locators/servers that have been provided via the property "secondary-locators=<host>[<port>],...".

#### disableStreaming_

    public boolean disableStreaming_

Flag to indicate that server side streaming of data is disabled.

#### skipListeners_

    public boolean skipListeners_

Flag to indicate the server side skip listeners property .

#### queryHDFS_

    public boolean queryHDFS_

Flag to indicate the server side queries HDFS data

#### skipConstraints_

    public boolean skipConstraints_

Flag to indicate that transactions on this connection should use "waiting mode" instead of "fail-fast conflict" detection.

#### syncCommits_

    public boolean syncCommits_

Flag to indicate that transactions on this connection should sync all commits before returning (i.e. wait for 2nd phase commit to be complete on all nodes).

#### disableTXBatching_

    public boolean disableTXBatching_

Flag to disable all batching in transactions, flushing ops immediately to detect conflicts immediately.

See Also:
  `ClientAttribute.DISABLE_TX_BATCHING`

#### singleHopEnabled_

    protected boolean singleHopEnabled_

If false then don't attempt fetching single hop information from the server.

#### singleHopAttempted

    public int singleHopAttempted

counter for testing to see how many single hops were actually done.

#### disableCancel_

    protected boolean disableCancel_

If true, then `Statement.cancel()` thru thin driver will not be supported. The driver will not ask for statementUUID from the server.

#### useBoundedQueuePool_

    public boolean useBoundedQueuePool_

#### ncjBatchSize_

    public int ncjBatchSize_

NCJ Batch Size

#### ncjCacheSize_

    public int ncjCacheSize_

NCJ Cache Size

#### skipLocks_

    protected boolean skipLocks_

if true then all DD and table locks are skipped for this connection

#### keepAliveIdle_

    public int keepAliveIdle_

#### keepAliveIntvl_

    public int keepAliveIntvl_

#### keepAliveCnt_

    public int keepAliveCnt_

#### DEFAULT_LOGIN_TIMEOUT

    public static final int DEFAULT_LOGIN_TIMEOUT

Maximum timeout in seconds for read before failover in case nothing is specified. Now this is 0 to indicate infinite since failure detection is now done using per-socket TCP keepalive.

See Also:
  Constant Field Values

#### INFINITE_LOGIN_TIMEOUT

    public static final int INFINITE_LOGIN_TIMEOUT

Special token to indicate infinite login timeout using the DriverManager.setLoginTimeout() API. When using the read-timeout connection property, the value zero indicates infinite timeout and is internally converted to this token.

See Also:
  Constant Field Values

#### DEFAULT_SINGLE_HOP_MAX_CONN_PER_SERVER

    public static final int DEFAULT_SINGLE_HOP_MAX_CONN_PER_SERVER

See Also:
  Constant Field Values

#### SINGLE_HOP_MAX_CONN_PER_SERVER

    public static int SINGLE_HOP_MAX_CONN_PER_SERVER

#### dncGeneratedSavepointId_

    public int dncGeneratedSavepointId_

#### dncGeneratedSavepointNamePrefix__

    public static final String dncGeneratedSavepointNamePrefix__

See Also:
  Constant Field Values

#### lobProcs

    protected CallableLocatorProcedures lobProcs

Reference to object with prepared statements for calling the locator procedures. Makes it possible to reuse prepared statements within the connection.

### Constructor Detail

#### Connection

    protected Connection(LogWriter logWriter,
              String user,
              String password,
              ClientBaseDataSource dataSource)
                  throws SqlException

Throws:
  `SqlException`

#### Connection

    protected Connection(LogWriter logWriter,
              String user,
              String password,
              boolean isXAConn,
              ClientBaseDataSource dataSource)
                  throws SqlException

Throws:
  `SqlException`

#### Connection

    protected Connection(LogWriter logWriter,
              boolean isXAConn,
              ClientBaseDataSource dataSource)
                  throws SqlException

Throws:
  `SqlException`

#### Connection

    protected Connection(LogWriter logWriter,
              int driverManagerLoginTimeout,
              String serverName,
              int portNumber,
              String databaseName,
              Properties properties)
                  throws SqlException

Throws:
  `SqlException`

### Method Detail

#### initConnection

    protected void initConnection(LogWriter logWriter,
                      String password,
                      ClientBaseDataSource dataSource)
                           throws SqlException

Throws:
  `SqlException`

#### init

    public static void init()

#### initialize

    public static void initialize()

#### preAgentInitialize

    protected abstract void preAgentInitialize(String password,
                          ClientBaseDataSource dataSource,
                          Properties properties)
                                        throws SqlException

Throws:
  `SqlException`

#### handleFailover

    public abstract Set handleFailover(Set failedUrls,
                     SqlException ex)
                                throws SqlException

Throws:
  `SqlException`

#### getServerLocation

    public abstract String getServerLocation()

#### getConnectionProperties

    public abstract Properties getConnectionProperties()

#### doFailoverOnException

    public abstract Connection.FailoverStatus doFailoverOnException(String sqlState,
                                                  int errorCode,
                                                  Exception thrownEx)

#### getOutputStream

    public abstract OutputStream getOutputStream()

#### getInputStream

    public abstract InputStream getInputStream()

#### resetConnection

    protected void resetConnection(LogWriter logWriter)
                            throws SqlException

Throws:
  `SqlException`

#### finalize

    protected void finalize()
                     throws Throwable

Overrides:
  `finalize` in class `Object`
Throws:
  `Throwable`

#### createStatement

    public Statement createStatement()
                              throws SQLException

Specified by:
  `createStatement` in interface `Connection`
Throws:
  `SQLException`

#### prepareStatement

    public PreparedStatement prepareStatement(String sql)
                                       throws SQLException

Specified by:
  `prepareStatement` in interface `Connection`
Throws:
  `SQLException`

#### preparePositionedUpdateStatement

    public PreparedStatement preparePositionedUpdateStatement(String sql,
                                                     Section querySection)
                                                       throws SqlException

Throws:
  `SqlException`

#### prepareCall

    public CallableStatement prepareCall(String sql)
                                  throws SQLException

Specified by:
  `prepareCall` in interface `Connection`
Throws:
  `SQLException`

#### nativeSQL

    public String nativeSQL(String sql)
                     throws SQLException

Specified by:
  `nativeSQL` in interface `Connection`
Throws:
  `SQLException`

#### nativeSQLX

    public String nativeSQLX(String sql)
                      throws SqlException

Throws:
  `SqlException`

#### allowLocalCommitRollback_

    protected abstract boolean allowLocalCommitRollback_()
                                                  throws SqlException

Throws:
  `SqlException`

#### setAutoCommitX

    protected final void setAutoCommitX(boolean autoCommit)
                                 throws SqlException

Throws:
  `SqlException`

#### setAutoCommit

    public void setAutoCommit(boolean autoCommit)
                       throws SQLException

Specified by:
  `setAutoCommit` in interface `Connection`
Throws:
  `SQLException`

#### getAutoCommit

    public boolean getAutoCommit()
                          throws SQLException

Specified by:
  `getAutoCommit` in interface `Connection`
Throws:
  `SQLException`

#### commit

    public void commit()
                throws SQLException

Specified by:
  `commit` in interface `Connection`
Throws:
  `SQLException`

#### flowCommit

    public void flowCommit()
                    throws SqlException

Throws:
  `SqlException`

#### flowAutoCommit

    public boolean flowAutoCommit()
                           throws SqlException

Throws:
  `SqlException`

#### willAutoCommitGenerateFlow

    public boolean willAutoCommitGenerateFlow()
                                       throws SqlException

Throws:
  `SqlException`

#### writeCommit

    public void writeCommit()
                     throws SqlException

Throws:
  `SqlException`

#### readCommit

    public void readCommit()
                    throws SqlException

Throws:
  `SqlException`

#### rollback

    public void rollback()
                  throws SQLException

Specified by:
  `rollback` in interface `Connection`
Throws:
  `SQLException`

#### flowRollback

    protected void flowRollback()
                         throws SqlException

Throws:
  `SqlException`

#### writeRollback

    public void writeRollback()
                       throws SqlException

Throws:
  `SqlException`

#### readRollback

    public void readRollback()
                      throws SqlException

Throws:
  `SqlException`

#### close

    public void close()
               throws SQLException

Specified by:
  `close` in interface `AutoCloseable`
Specified by:
  `close` in interface `Connection`
Throws:
  `SQLException`

#### transactionInProgress

    public boolean transactionInProgress()

Check if there are uncommitted operations in the current transaction that prevent us from closing the connection.

Returns:
  `true` if the connection cannot be closed due to uncommitted operations in the transaction

#### closeX

    public void closeX()
                throws SQLException

Throws:
  `SQLException`

#### closeResources

    public void closeResources()
                        throws SQLException

Throws:
  `SQLException`

#### isGlobalPending_

    protected abstract boolean isGlobalPending_()

#### closeForReuse

    public void closeForReuse(boolean statementPooling)
                       throws SqlException

Throws:
  `SqlException`

#### markClosed_

    protected abstract void markClosed_()

#### markOpen

    protected final void markOpen(String method)

#### markClosed

    protected final void markClosed()

#### markClosed

    public void markClosed(boolean statementPooling)

#### isPhysicalConnClosed

    public boolean isPhysicalConnClosed()

Return true if the physical connection is still open. Might be logically closed but available for reuse.

Returns:
  true if physical connection still open

#### isClosed

    public final boolean isClosed()

Specified by:
  `isClosed` in interface `Connection`

#### isClosedX

    public final boolean isClosedX()

#### isOpen

    public final boolean isOpen()

Returns if a transaction is in process

Returns:
  open

#### setTransactionIsolation

    public void setTransactionIsolation(int level)
                                 throws SQLException

Specified by:
  `setTransactionIsolation` in interface `Connection`
Throws:
  `SQLException`

#### setTransactionIsolationX

    protected final void setTransactionIsolationX(int level)
                                           throws SqlException

Set the transaction isolation level as specified.

If this method is called during a transaction, the result is implementation-defined.

Information about Derby specific isolation level handling:

- REPEATABLE_READ = JDBC: TRANSACTION_SERIALIZABLE, DERBY: RR, PROTOCOL: repeatable read
- READ_STABILITY = JDBC: TRANSACTION_REPEATABLE_READ, DERBY: RS, PROTOCOL: All
- CURSOR_STABILITY = JDBC: TRANSACTION_READ_COMMITTED, DERBY: CS, PROTOCOL: Cursor stability
- UNCOMMITTED_READ = JDBC: TRANSACTION_READ_UNCOMMITTED, DERBY: UR, PROTOCOL: Change
- NO_COMMIT = JDBC: TRANSACTION_NONE, DERBY: NC, PROTOCOL: No commit

Throws:
  `SqlException`

#### supportsSessionDataCaching

    protected abstract boolean supportsSessionDataCaching()

Finds out if the underlaying database connection supports session data caching.

Returns:
  true if sessionData is supported

#### serverSupportsLocators

    protected abstract boolean serverSupportsLocators()

Checks whether the server supports locators for large objects. Note that even though the server supports LOB locators, the database that is accessed through the server may not have the necessary stored procedures to support LOB locators (e.g., because the database is soft upgraded from an earlier version).

Returns:
  `true` if LOB locators are supported.

#### getTransactionIsolation

    public int getTransactionIsolation()
                                throws SQLException

Specified by:
  `getTransactionIsolation` in interface `Connection`
Throws:
  `SQLException`

#### getTransactionIsolationX

    public int getTransactionIsolationX()
                                 throws SQLException

Throws:
  `SQLException`

#### getTransactionID

    public int getTransactionID()

Returns the ID of the active transaction for this connection.

Returns:
  the ID of the active transaction

#### getCurrentSchemaName

    public String getCurrentSchemaName()
                                throws SQLException

Returns the current schema (the schema that would be used for compilation. This is not part of the java.sql.Connection interface, and is only intended for use with statement caching.

Returns:
  the name of the current schema
Throws:
  `SQLException`

#### getWarnings

    public SQLWarning getWarnings()
                           throws SQLException

Specified by:
  `getWarnings` in interface `Connection`
Throws:
  `SQLException`

#### clearWarnings

    public void clearWarnings()
                       throws SQLException

Specified by:
  `clearWarnings` in interface `Connection`
Throws:
  `SQLException`

#### clearWarningsX

    public void clearWarningsX()
                        throws SqlException

Throws:
  `SqlException`

#### getMetaData

    public DatabaseMetaData getMetaData()
                                 throws SQLException

Specified by:
  `getMetaData` in interface `Connection`
Throws:
  `SQLException`

#### setReadOnly

    public void setReadOnly(boolean readOnly)
                     throws SQLException

Specified by:
  `setReadOnly` in interface `Connection`
Throws:
  `SQLException`

#### isReadOnly

    public boolean isReadOnly()
                       throws SQLException

Specified by:
  `isReadOnly` in interface `Connection`
Throws:
  `SQLException`

#### setCatalog

    public void setCatalog(String catalog)
                    throws SQLException

Specified by:
  `setCatalog` in interface `Connection`
Throws:
  `SQLException`

#### getCatalog

    public String getCatalog()
                      throws SQLException

Specified by:
  `getCatalog` in interface `Connection`
Throws:
  `SQLException`

#### createStatement

    public Statement createStatement(int resultSetType,
                            int resultSetConcurrency)
                              throws SQLException

Specified by:
  `createStatement` in interface `Connection`
Throws:
  `SQLException`

#### prepareStatement

    public PreparedStatement prepareStatement(String sql,
                                     int resultSetType,
                                     int resultSetConcurrency)
                                       throws SQLException

Specified by:
  `prepareStatement` in interface `Connection`
Throws:
  `SQLException`

#### prepareCall

    public CallableStatement prepareCall(String sql,
                                int resultSetType,
                                int resultSetConcurrency)
                                  throws SQLException

Specified by:
  `prepareCall` in interface `Connection`
Throws:
  `SQLException`

#### prepareMessageProc

    public CallableStatement prepareMessageProc(String sql)
                                         throws SqlException

Throws:
  `SqlException`

#### getTypeMap

    public Map getTypeMap()
                   throws SQLException

Specified by:
  `getTypeMap` in interface `Connection`
Throws:
  `SQLException`

#### setTypeMap

    public void setTypeMap(Map map)
                    throws SQLException

Specified by:
  `setTypeMap` in interface `Connection`
Throws:
  `SQLException`

#### setHoldability

    public void setHoldability(int holdability)
                        throws SQLException

Specified by:
  `setHoldability` in interface `Connection`
Throws:
  `SQLException`

#### getHoldability

    public int getHoldability()
                       throws SQLException

Specified by:
  `getHoldability` in interface `Connection`
Throws:
  `SQLException`

#### setSavepoint

    public Savepoint setSavepoint()
                           throws SQLException

Specified by:
  `setSavepoint` in interface `Connection`
Throws:
  `SQLException`

#### setSavepoint

    public Savepoint setSavepoint(String name)
                           throws SQLException

Specified by:
  `setSavepoint` in interface `Connection`
Throws:
  `SQLException`

#### rollback

    public void rollback(Savepoint savepoint)
                  throws SQLException

Specified by:
  `rollback` in interface `Connection`
Throws:
  `SQLException`

#### releaseSavepoint

    public void releaseSavepoint(Savepoint savepoint)
                          throws SQLException

Specified by:
  `releaseSavepoint` in interface `Connection`
Throws:
  `SQLException`

#### createStatement

    public Statement createStatement(int resultSetType,
                            int resultSetConcurrency,
                            int resultSetHoldability)
                              throws SQLException

Specified by:
  `createStatement` in interface `Connection`
Throws:
  `SQLException`

#### resetStatement

    protected void resetStatement(Statement s)
                           throws SqlException

Throws:
  `SqlException`

#### prepareStatement

    public PreparedStatement prepareStatement(String sql,
                                     int resultSetType,
                                     int resultSetConcurrency,
                                     int resultSetHoldability)
                                       throws SQLException

Specified by:
  `prepareStatement` in interface `Connection`
Throws:
  `SQLException`

#### resetPrepareStatement

    protected void resetPrepareStatement(PreparedStatement ps)
                                  throws SqlException

Throws:
  `SqlException`

#### prepareCall

    public CallableStatement prepareCall(String sql,
                                int resultSetType,
                                int resultSetConcurrency,
                                int resultSetHoldability)
                                  throws SQLException

Specified by:
  `prepareCall` in interface `Connection`
Throws:
  `SQLException`

#### resetPrepareCall

    protected void resetPrepareCall(CallableStatement cs)
                             throws SqlException

Throws:
  `SqlException`

#### prepareStatement

    public PreparedStatement prepareStatement(String sql,
                                     int autoGeneratedKeys)
                                       throws SQLException

Specified by:
  `prepareStatement` in interface `Connection`
Throws:
  `SQLException`

#### prepareStatement

    public PreparedStatement prepareStatement(String sql,
                                     int[] columnIndexes)
                                       throws SQLException

Specified by:
  `prepareStatement` in interface `Connection`
Throws:
  `SQLException`

#### prepareStatement

    public PreparedStatement prepareStatement(String sql,
                                     String[] columnNames)
                                       throws SQLException

Specified by:
  `prepareStatement` in interface `Connection`
Throws:
  `SQLException`

#### allowCloseInUOW_

    protected abstract boolean allowCloseInUOW_()

#### doCloseStatementsOnClose_

    protected abstract boolean doCloseStatementsOnClose_()

#### newSectionManager

    public abstract SectionManager newSectionManager(String collection,
                                   Agent agent,
                                   String databaseName)

#### newAgent_

    protected abstract Agent newAgent_(LogWriter logWriter,
                  int loginTimeout,
                  String serverName,
                  int portNumber,
                  int clientSSLMode,
                  Properties properties)
                                throws SqlException

Throws:
  `SqlException`

#### newDatabaseMetaData_

    protected abstract DatabaseMetaData newDatabaseMetaData_()

#### newStatement_

    protected abstract Statement newStatement_(int type,
                          int concurrency,
                          int holdability)
                                        throws SqlException

Throws:
  `SqlException`

#### resetStatement_

    protected abstract void resetStatement_(Statement statement,
                       int type,
                       int concurrency,
                       int holdability)
                                     throws SqlException

Throws:
  `SqlException`

#### newPositionedUpdatePreparedStatement_

    protected abstract PreparedStatement newPositionedUpdatePreparedStatement_(String sql,
                                                          Section section)
                                                                        throws SqlException

Throws:
  `SqlException`

#### newPreparedStatement_

    protected abstract PreparedStatement newPreparedStatement_(String sql,
                                          int type,
                                          int concurrency,
                                          int holdability,
                                          int autoGeneratedKeys,
                                          String[] columnNames,
                                          int[] columnIndexes)
                                                        throws SqlException

Throws:
  `SqlException`

#### resetPreparedStatement_

    protected abstract void resetPreparedStatement_(PreparedStatement ps,
                               String sql,
                               int resultSetType,
                               int resultSetConcurrency,
                               int resultSetHoldability,
                               int autoGeneratedKeys,
                               String[] columnNames,
                               int[] columnIndexes)
                                             throws SqlException

Throws:
  `SqlException`

#### newCallableStatement_

    protected abstract CallableStatement newCallableStatement_(String sql,
                                          int type,
                                          int concurrency,
                                          int holdability)
                                                        throws SqlException

Throws:
  `SqlException`

#### resetCallableStatement_

    protected abstract void resetCallableStatement_(CallableStatement cs,
                               String sql,
                               int resultSetType,
                               int resultSetConcurrency,
                               int resultSetHoldability)
                                             throws SqlException

Throws:
  `SqlException`

#### completeConnect

    public void completeConnect()
                         throws SqlException

Throws:
  `SqlException`

#### writeCommitSubstitute_

    public abstract void writeCommitSubstitute_()
                                         throws SqlException

Throws:
  `SqlException`

#### readCommitSubstitute_

    public abstract void readCommitSubstitute_()
                                        throws SqlException

Throws:
  `SqlException`

#### writeLocalXAStart_

    public abstract void writeLocalXAStart_()
                                     throws SqlException

Throws:
  `SqlException`

#### readLocalXAStart_

    public abstract void readLocalXAStart_()
                                    throws SqlException

Throws:
  `SqlException`

#### writeLocalXACommit_

    public abstract void writeLocalXACommit_()
                                      throws SqlException

Throws:
  `SqlException`

#### writeXACommit_

    protected abstract void writeXACommit_()
                                    throws SqlException

Throws:
  `SqlException`

#### readLocalXACommit_

    public abstract void readLocalXACommit_()
                                     throws SqlException

Throws:
  `SqlException`

#### readXACommit_

    protected abstract void readXACommit_()
                                   throws SqlException

Throws:
  `SqlException`

#### writeLocalCommit_

    public abstract void writeLocalCommit_()
                                    throws SqlException

Throws:
  `SqlException`

#### readLocalCommit_

    public abstract void readLocalCommit_()
                                   throws SqlException

Throws:
  `SqlException`

#### writeXATransactionStart

    protected abstract void writeXATransactionStart(Statement statement)
                                             throws SqlException

Throws:
  `SqlException`

#### completeLocalCommit

    public void completeLocalCommit()

Specified by:
  `completeLocalCommit` in interface `ConnectionCallbackInterface`

#### writeLocalRollback_

    public abstract void writeLocalRollback_()
                                      throws SqlException

Throws:
  `SqlException`

#### readLocalRollback_

    public abstract void readLocalRollback_()
                                     throws SqlException

Throws:
  `SqlException`

#### completeLocalRollback

    public void completeLocalRollback()

Specified by:
  `completeLocalRollback` in interface `ConnectionCallbackInterface`

#### completeSpecificRollback

    public void completeSpecificRollback(UnitOfWorkListener uwl)

Rollback the specific UnitOfWorkListener.

Parameters:
  `uwl` - The UnitOfWorkLitener to be rolled back

#### writeLocalXARollback_

    public abstract void writeLocalXARollback_()
                                        throws SqlException

Throws:
  `SqlException`

#### writeXARollback_

    protected abstract void writeXARollback_()
                                      throws SqlException

Throws:
  `SqlException`

#### readLocalXARollback_

    public abstract void readLocalXARollback_()
                                       throws SqlException

Throws:
  `SqlException`

#### readXARollback_

    protected abstract void readXARollback_()
                                     throws SqlException

Throws:
  `SqlException`

#### writeTransactionStart

    public void writeTransactionStart(Statement statement)
                               throws SqlException

Throws:
  `SqlException`

#### readTransactionStart

    public void readTransactionStart()
                              throws SqlException

Throws:
  `SqlException`

#### completeAbnormalUnitOfWork

    public void completeAbnormalUnitOfWork()

Specified by:
  `completeAbnormalUnitOfWork` in interface `ConnectionCallbackInterface`

#### completeAbnormalUnitOfWork

    public void completeAbnormalUnitOfWork(UnitOfWorkListener uwl)

Rollback the UnitOfWorkListener specifically.

Specified by:
  `completeAbnormalUnitOfWork` in interface `ConnectionCallbackInterface`
Parameters:
  `uwl` - The UnitOfWorkListener to be rolled back.

#### completeChainBreakingDisconnect

    public void completeChainBreakingDisconnect()

Specified by:
  `completeChainBreakingDisconnect` in interface `ConnectionCallbackInterface`

#### completeSqlca

    public void completeSqlca(Sqlca sqlca)

Specified by:
  `completeSqlca` in interface `ConnectionCallbackInterface`

#### completePiggyBackIsolation

    public void completePiggyBackIsolation(int pbIsolation)

Description copied from interface: `ConnectionCallbackInterface`
Completes piggy-backing of the new current isolation level by updating the cached copy in am.Connection.

Specified by:
  `completePiggyBackIsolation` in interface `ConnectionCallbackInterface`
Parameters:
  `pbIsolation` - new isolation level from the server

#### completeServerVersion

    public void completeServerVersion(int majorVersion)

#### completeInitialPiggyBackIsolation

    public void completeInitialPiggyBackIsolation(int pbIsolation)

Sets the default isolation level of the connection upon connection initialization.

Note that depending on the server version, the default isolation value may not be piggy-backed on the initialization flow. In that case, the default is assumed / hardcoded to be READ_COMMITTED.

Parameters:
  `pbIsolation` - isolation level as specified by `java.sql.Connection`

#### completePiggyBackSchema

    public void completePiggyBackSchema(String pbSchema)

Description copied from interface: `ConnectionCallbackInterface`
Completes piggy-backing of the new current schema by updating the cached copy in am.Connection.

Specified by:
  `completePiggyBackSchema` in interface `ConnectionCallbackInterface`
Parameters:
  `pbSchema` - new current schema from the server

#### completeInitialPiggyBackSchema

    public void completeInitialPiggyBackSchema(String pbSchema)

Sets the current schema upon connection initialization.

Parameters:
  `pbSchema` - the schema name

#### addSpecialRegisters

    public abstract void addSpecialRegisters(String s)

#### reset

    public void reset(LogWriter logWriter)
               throws SqlException

Throws:
  `SqlException`

#### lightReset

    public void lightReset()
                    throws SqlException

Throws:
  `SqlException`

#### reset_

    protected abstract void reset_(LogWriter logWriter)
                            throws SqlException

Throws:
  `SqlException`

#### completeReset

    protected void completeReset(boolean isDeferredReset,
                     boolean closeStatementsOnClose,
                     NetXAResource xares)
                          throws SqlException

NOTE:The following comments are valid for the changes done as part of implementing statement caching only (see DERBY-3313 and linked issues).

We don't reset the isolation level to unknown unconditionally, as this forces us to go to the server all the time. Since the value should now be valid (DERBY-3192), we check if it has been changed from the default.

Parameters:
  `closeStatementsOnClose` - is used to differentiate between cases where statement pooling is enabled or not. If `true`, it means statement pooling is disabled and the statements are fully reset, which includes a re-prepare. If `false`, statement pooling is enabled, and a more lightweight reset procedure is used.
Throws:
  `SqlException`

#### completeReset

    protected void completeReset(boolean isDeferredReset,
                     boolean closeStatementsOnClose,
                     boolean fullReset)
                          throws SqlException

Throws:
  `SqlException`

#### locatorProcedureCall

    protected CallableLocatorProcedures locatorProcedureCall()

Get handle to the object that contains prepared statements for calling locator procedures for this connection. The object will be created on the first invocation. An example of how to call a stored procedure via this method:

        connection.locatorProcedureCall().blobReleaseLocator(locator);

Returns:
  object with prepared statements for calling locator procedures

#### checkForClosedConnection

    protected void checkForClosedConnection()
                                     throws SqlException

Throws:
  `SqlException`

#### isXAConnection

    public boolean isXAConnection()

#### getXAState

    public int getXAState()

#### setXAState

    public void setXAState(int state)

#### accumulateWarning

    public void accumulateWarning(SqlWarning e)

#### accumulate440WarningForMessageProcFailure

    public void accumulate440WarningForMessageProcFailure(SqlWarning e)

#### accumulate444WarningForMessageProcFailure

    public void accumulate444WarningForMessageProcFailure(SqlWarning e)

#### getServerVersion

    public int getServerVersion()

#### setInUnitOfWork

    public void setInUnitOfWork(boolean inUnitOfWork)

#### createClob

    public Clob createClob()
                    throws SQLException

Constructs an object that implements the `Clob` interface. The object returned initially contains no data.

Specified by:
  `createClob` in interface `Connection`
Returns:
  An object that implements the `Clob` interface
Throws:
  `SQLException` - if an object that implements the `Clob` interface can not be constructed.

#### isSingleHopEnabled

    public boolean isSingleHopEnabled()

Constructs an object that implements the `Blob` interface. The object returned initially contains no data.

Returns:
  An object that implements the `Blob` interface
Throws:
  `SQLException` - if an object that implements the Blob interface can not be constructed.

#### cancelDisabled

    public boolean cancelDisabled()

#### createBlob

    public Blob createBlob()
                    throws SQLException

Specified by:
  `createBlob` in interface `Connection`
Throws:
  `SQLException`

#### incrementAndGetExecutionSequence

    public int incrementAndGetExecutionSequence()