java.lang.AutoCloseable
, java.sql.Connection
, java.sql.Wrapper
, ConnectionCallbackInterface
NetConnection
public abstract class ClientConnection extends java.lang.Object implements java.sql.Connection, ConnectionCallbackInterface
Modifier and Type | Field | Description |
---|---|---|
private boolean |
aborting_ |
|
private boolean |
accumulated440ForMessageProcFailure_ |
|
private boolean |
accumulated444ForMessageProcFailure_ |
|
Agent |
agent_ |
|
boolean |
autoCommit_ |
|
private boolean |
availableForReuse_ |
|
(package private) java.util.Hashtable<java.lang.String,java.lang.String> |
clientCursorNameCache_ |
|
private int |
clientSSLMode_ |
|
int |
commBufferSize_ |
|
(package private) java.util.WeakHashMap<UnitOfWorkListener,java.lang.Void> |
CommitAndRollbackListeners_ |
|
private java.lang.String |
currentSchemaName_ |
Cached copy of the schema name.
|
ClientDatabaseMetaData |
databaseMetaData_ |
|
java.lang.String |
databaseName_ |
|
BasicClientDataSource40 |
dataSource_ |
|
private int |
defaultIsolation |
The default isolation level, enforced on connection resets.
|
private static java.lang.String |
DERBY_TRANSACTION_READ_COMMITTED |
|
private static java.lang.String |
DERBY_TRANSACTION_READ_UNCOMMITTED |
|
private static java.lang.String |
DERBY_TRANSACTION_REPEATABLE_READ |
|
private static java.lang.String |
DERBY_TRANSACTION_SERIALIZABLE |
|
private int |
dncGeneratedSavepointId_ |
|
private static java.lang.String |
dncGeneratedSavepointNamePrefix__ |
|
protected EncryptionManager |
encryptionManager_ |
|
private ClientPreparedStatement |
getTransactionIsolationPrepStmt |
|
private int |
holdability |
Holdabilty for created statements.
|
protected boolean |
inUnitOfWork_ |
|
private static int |
INVALID_LOCATOR |
|
private int |
isolation_ |
Cached copy of the isolation level.
|
private java.util.HashMap<java.lang.String,ClientPreparedStatement> |
isolationLevelPreparedStmts |
|
protected boolean |
isXAConnection_ |
|
private boolean |
jdbcReadOnly_ |
|
private CallableLocatorProcedures |
lobProcs |
Reference to object with prepared statements for calling the locator
procedures.
|
private int |
loginTimeout_ |
|
protected boolean |
open_ |
|
(package private) java.util.WeakHashMap<ClientStatement,java.lang.Void> |
openStatements_ |
|
int |
portNumber_ |
|
java.lang.String |
productID_ |
|
boolean |
resetConnectionAtFirstSql_ |
|
(package private) boolean |
retrieveMessageText_ |
|
java.lang.String |
serverNameIP_ |
|
private static int |
TRANSACTION_UNKNOWN |
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).
|
private int |
transactionID_ |
|
protected java.lang.String |
user_ |
|
private SqlWarning |
warnings_ |
|
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_ |
|
private int |
xaState_ |
Modifier | Constructor | Description |
---|---|---|
protected |
ClientConnection(LogWriter logWriter,
boolean isXAConn,
BasicClientDataSource40 dataSource) |
|
protected |
ClientConnection(LogWriter logWriter,
int driverManagerLoginTimeout,
java.lang.String serverName,
int portNumber,
java.lang.String databaseName,
java.util.Properties properties) |
|
protected |
ClientConnection(LogWriter logWriter,
java.lang.String user,
java.lang.String password,
boolean isXAConn,
BasicClientDataSource40 dataSource) |
|
protected |
ClientConnection(LogWriter logWriter,
java.lang.String user,
java.lang.String password,
BasicClientDataSource40 dataSource) |
Modifier and Type | Method | Description |
---|---|---|
void |
abort(java.util.concurrent.Executor executor) |
|
(package private) void |
accumulate440WarningForMessageProcFailure(SqlWarning e) |
|
(package private) void |
accumulate444WarningForMessageProcFailure(SqlWarning e) |
|
private void |
accumulateWarning(SqlWarning e) |
|
protected abstract boolean |
allowCloseInUOW_() |
|
protected abstract boolean |
allowLocalCommitRollback_() |
|
protected void |
beginAborting() |
Begin aborting the connection
|
protected void |
checkForClosedConnection() |
|
private void |
checkForInvalidXAStateOnCommitOrRollback() |
|
(package private) void |
checkForTransactionInProgress() |
Check if the transaction is in progress and the connection cannot be
closed.
|
void |
clearWarnings() |
|
private void |
clearWarningsX() |
|
void |
close() |
|
(package private) void |
closeForReuse(boolean statementPooling) |
|
void |
closeResources() |
|
private void |
closeResourcesX() |
|
private 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(java.lang.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(java.lang.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,
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). |
private void |
completeSpecificRollback(UnitOfWorkListener uwl) |
Rollback the specific UnitOfWorkListener.
|
void |
completeSqlca(Sqlca sqlca) |
|
(package private) void |
completeTransactionStart() |
|
java.sql.Blob |
createBlob() |
Constructs an object that implements the
Blob interface. |
java.sql.Clob |
createClob() |
Constructs an object that implements the
Clob interface. |
java.sql.Statement |
createStatement() |
|
java.sql.Statement |
createStatement(int resultSetType,
int resultSetConcurrency) |
|
java.sql.Statement |
createStatement(int resultSetType,
int resultSetConcurrency,
int resultSetHoldability) |
|
private ClientStatement |
createStatementX(int resultSetType,
int resultSetConcurrency,
int resultSetHoldability) |
|
protected abstract boolean |
doCloseStatementsOnClose_() |
|
private int |
downgradeResultSetType(int resultSetType) |
|
protected void |
finalize() |
|
boolean |
flowAutoCommit() |
|
private void |
flowClose() |
|
private void |
flowCommit() |
|
protected void |
flowRollback() |
|
boolean |
getAutoCommit() |
|
java.lang.String |
getCatalog() |
|
java.lang.String |
getCurrentSchemaName() |
Returns the current schema (the schema that would be used for
compilation.
|
int |
getHoldability() |
|
java.sql.DatabaseMetaData |
getMetaData() |
|
int |
getNetworkTimeout() |
|
java.lang.String |
getSchema() |
Get the name of the current schema.
|
int |
getServerVersion() |
|
int |
getTransactionID() |
Returns the ID of the active transaction for this connection.
|
int |
getTransactionIsolation() |
|
int |
getTransactionIsolationX() |
|
java.util.Map<java.lang.String,java.lang.Class<?>> |
getTypeMap() |
|
java.sql.SQLWarning |
getWarnings() |
|
int |
getXAState() |
|
(package private) int |
holdability() |
Return the holdabilty for the Connection.
|
private void |
initConnection(LogWriter logWriter,
BasicClientDataSource40 dataSource) |
|
boolean |
isAborting() |
Return true if the connection is aborting
|
boolean |
isClosed() |
|
boolean |
isClosedX() |
|
protected abstract boolean |
isGlobalPending_() |
|
boolean |
isPhysicalConnClosed() |
Return true if the physical connection is still open.
|
boolean |
isReadOnly() |
|
boolean |
isXAConnection() |
|
void |
lightReset() |
|
(package private) CallableLocatorProcedures |
locatorProcedureCall() |
Get handle to the object that contains prepared statements for calling
locator procedures for this connection.
|
private void |
markClosed(boolean statementPooling) |
|
protected abstract void |
markClosed_() |
|
private void |
markClosedForReuse(boolean statementPooling) |
|
private void |
markStatementsClosed() |
|
java.lang.String |
nativeSQL(java.lang.String sql) |
|
(package private) java.lang.String |
nativeSQLX(java.lang.String sql) |
|
protected abstract Agent |
newAgent_(LogWriter logWriter,
int loginTimeout,
java.lang.String serverName,
int portNumber,
int clientSSLMode) |
|
protected abstract ClientCallableStatement |
newCallableStatement_(java.lang.String sql,
int type,
int concurrency,
int holdability) |
|
protected abstract ClientDatabaseMetaData |
newDatabaseMetaData_() |
|
protected abstract ClientPreparedStatement |
newPositionedUpdatePreparedStatement_(java.lang.String sql,
Section section) |
|
protected abstract ClientPreparedStatement |
newPreparedStatement_(java.lang.String sql,
int type,
int concurrency,
int holdability,
int autoGeneratedKeys,
java.lang.String[] columnNames,
int[] columnIndexes) |
|
abstract SectionManager |
newSectionManager(Agent agent) |
|
protected abstract ClientStatement |
newStatement_(int type,
int concurrency,
int holdability) |
|
java.sql.CallableStatement |
prepareCall(java.lang.String sql) |
|
java.sql.CallableStatement |
prepareCall(java.lang.String sql,
int resultSetType,
int resultSetConcurrency) |
|
java.sql.CallableStatement |
prepareCall(java.lang.String sql,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability) |
|
(package private) ClientCallableStatement |
prepareCallX(java.lang.String sql,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability) |
|
(package private) ClientPreparedStatement |
prepareDynamicCatalogQuery(java.lang.String sql) |
|
(package private) ClientCallableStatement |
prepareMessageProc(java.lang.String sql) |
|
(package private) ClientPreparedStatement |
preparePositionedUpdateStatement(java.lang.String sql,
Section querySection) |
|
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql) |
|
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
int autoGeneratedKeys) |
|
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
int[] columnIndexes) |
|
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
int resultSetType,
int resultSetConcurrency) |
|
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability) |
|
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
java.lang.String[] columnNames) |
|
(package private) ClientPreparedStatement |
prepareStatementX(java.lang.String sql,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability,
int autoGeneratedKeys,
java.lang.String[] columnNames,
int[] columnIndexes) |
|
(package private) void |
readAutoCommit() |
|
private void |
readCloseStatements() |
|
(package private) void |
readCommit() |
|
abstract void |
readCommitSubstitute_() |
|
abstract void |
readLocalCommit_() |
|
abstract void |
readLocalRollback_() |
|
abstract void |
readLocalXACommit_() |
|
abstract void |
readLocalXARollback_() |
|
abstract void |
readLocalXAStart_() |
|
private void |
readRollback() |
|
void |
readTransactionStart() |
|
protected abstract void |
readXACommit_() |
|
protected abstract void |
readXARollback_() |
|
void |
releaseSavepoint(java.sql.Savepoint savepoint) |
|
void |
reset(LogWriter logWriter) |
|
protected abstract void |
reset_(LogWriter logWriter) |
|
protected abstract void |
resetCallableStatement_(ClientCallableStatement cs,
java.lang.String sql,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability) |
|
protected void |
resetConnection(LogWriter logWriter) |
|
protected void |
resetPrepareCall(ClientCallableStatement cs) |
|
protected abstract void |
resetPreparedStatement_(ClientPreparedStatement ps,
java.lang.String sql,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability,
int autoGeneratedKeys,
java.lang.String[] columnNames,
int[] columnIndexes) |
|
protected void |
resetPrepareStatement(ClientPreparedStatement ps) |
|
protected void |
resetStatement(ClientStatement s) |
|
protected abstract void |
resetStatement_(ClientStatement statement,
int type,
int concurrency,
int holdability) |
|
void |
rollback() |
|
void |
rollback(java.sql.Savepoint savepoint) |
|
protected abstract boolean |
serverSupportsLocators() |
Checks whether the server supports locators for large objects.
|
protected abstract boolean |
serverSupportsTimestampNanoseconds() |
Return true if the server supports nanoseconds in timestamps
|
void |
setAutoCommit(boolean autoCommit) |
|
void |
setCatalog(java.lang.String catalog) |
|
void |
setHoldability(int holdability) |
|
void |
setNetworkTimeout(java.util.concurrent.Executor executor,
int milliseconds) |
|
void |
setReadOnly(boolean readOnly) |
|
java.sql.Savepoint |
setSavepoint() |
|
java.sql.Savepoint |
setSavepoint(java.lang.String name) |
|
private ClientSavepoint |
setSavepointX(ClientSavepoint savepoint) |
|
void |
setSchema(java.lang.String schemaName) |
Set the default schema for the Connection.
|
void |
setTransactionIsolation(int level) |
|
private void |
setTransactionIsolationX(int level) |
Set the transaction isolation level as specified.
|
void |
setTypeMap(java.util.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.
|
private int |
translateIsolation(java.lang.String isolationStr) |
Translates the isolation level from a SQL string to the JDBC int value
|
boolean |
willAutoCommitGenerateFlow() |
|
(package private) void |
writeAutoCommit() |
|
private void |
writeCloseStatements() |
|
(package private) void |
writeCommit() |
|
abstract void |
writeCommitSubstitute_() |
|
abstract void |
writeLocalCommit_() |
|
abstract void |
writeLocalRollback_() |
|
abstract void |
writeLocalXACommit_() |
|
abstract void |
writeLocalXARollback_() |
|
abstract void |
writeLocalXAStart_() |
|
private void |
writeRollback() |
|
void |
writeTransactionStart(ClientStatement statement) |
|
protected abstract void |
writeXACommit_() |
|
protected abstract void |
writeXARollback_() |
|
protected abstract void |
writeXATransactionStart(ClientStatement statement) |
beginRequest, createArrayOf, createNClob, createSQLXML, createStruct, endRequest, getClientInfo, getClientInfo, isValid, setClientInfo, setClientInfo, setShardingKey, setShardingKey, setShardingKeyIfValid, setShardingKeyIfValid
public Agent agent_
public ClientDatabaseMetaData databaseMetaData_
final java.util.WeakHashMap<ClientStatement,java.lang.Void> openStatements_
final java.util.WeakHashMap<UnitOfWorkListener,java.lang.Void> CommitAndRollbackListeners_
private SqlWarning warnings_
private static final int INVALID_LOCATOR
protected final java.lang.String user_
boolean retrieveMessageText_
private boolean jdbcReadOnly_
private int holdability
public java.lang.String databaseName_
public java.lang.String productID_
protected EncryptionManager encryptionManager_
private final java.util.HashMap<java.lang.String,ClientPreparedStatement> isolationLevelPreparedStmts
private ClientPreparedStatement getTransactionIsolationPrepStmt
protected boolean open_
private boolean aborting_
private boolean availableForReuse_
private static final int TRANSACTION_UNKNOWN
private int isolation_
private int defaultIsolation
Note that this value may be changed upon connection initialization in the future, as the server can piggy-back the isolation level.
private java.lang.String currentSchemaName_
public boolean autoCommit_
protected boolean inUnitOfWork_
private boolean accumulated440ForMessageProcFailure_
private boolean accumulated444ForMessageProcFailure_
private int transactionID_
protected boolean isXAConnection_
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.public static final int XA_T1_ASSOCIATED
XA_T1_ASSOCIATED
In this state commits will not flow in autocommit mode.private int xaState_
public int xaHostVersion_
private int loginTimeout_
public BasicClientDataSource40 dataSource_
public java.lang.String serverNameIP_
public int portNumber_
private int clientSSLMode_
java.util.Hashtable<java.lang.String,java.lang.String> clientCursorNameCache_
public int commBufferSize_
public boolean resetConnectionAtFirstSql_
private static java.lang.String DERBY_TRANSACTION_REPEATABLE_READ
private static java.lang.String DERBY_TRANSACTION_SERIALIZABLE
private static java.lang.String DERBY_TRANSACTION_READ_COMMITTED
private static java.lang.String DERBY_TRANSACTION_READ_UNCOMMITTED
private int dncGeneratedSavepointId_
private static final java.lang.String dncGeneratedSavepointNamePrefix__
private CallableLocatorProcedures lobProcs
protected ClientConnection(LogWriter logWriter, java.lang.String user, java.lang.String password, BasicClientDataSource40 dataSource) throws SqlException
SqlException
protected ClientConnection(LogWriter logWriter, java.lang.String user, java.lang.String password, boolean isXAConn, BasicClientDataSource40 dataSource) throws SqlException
SqlException
protected ClientConnection(LogWriter logWriter, boolean isXAConn, BasicClientDataSource40 dataSource) throws SqlException
SqlException
protected ClientConnection(LogWriter logWriter, int driverManagerLoginTimeout, java.lang.String serverName, int portNumber, java.lang.String databaseName, java.util.Properties properties) throws SqlException
SqlException
private void initConnection(LogWriter logWriter, BasicClientDataSource40 dataSource) throws SqlException
SqlException
protected void resetConnection(LogWriter logWriter) throws SqlException
SqlException
protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
public java.sql.Statement createStatement() throws java.sql.SQLException
createStatement
in interface java.sql.Connection
java.sql.SQLException
public java.sql.PreparedStatement prepareStatement(java.lang.String sql) throws java.sql.SQLException
prepareStatement
in interface java.sql.Connection
java.sql.SQLException
ClientPreparedStatement preparePositionedUpdateStatement(java.lang.String sql, Section querySection) throws SqlException
SqlException
public java.sql.CallableStatement prepareCall(java.lang.String sql) throws java.sql.SQLException
prepareCall
in interface java.sql.Connection
java.sql.SQLException
ClientPreparedStatement prepareDynamicCatalogQuery(java.lang.String sql) throws SqlException
SqlException
public java.lang.String nativeSQL(java.lang.String sql) throws java.sql.SQLException
nativeSQL
in interface java.sql.Connection
java.sql.SQLException
java.lang.String nativeSQLX(java.lang.String sql) throws SqlException
SqlException
protected abstract boolean allowLocalCommitRollback_() throws SqlException
SqlException
public void setAutoCommit(boolean autoCommit) throws java.sql.SQLException
setAutoCommit
in interface java.sql.Connection
java.sql.SQLException
public boolean getAutoCommit() throws java.sql.SQLException
getAutoCommit
in interface java.sql.Connection
java.sql.SQLException
public void commit() throws java.sql.SQLException
commit
in interface java.sql.Connection
java.sql.SQLException
private void checkForInvalidXAStateOnCommitOrRollback() throws SqlException
SqlException
private void flowCommit() throws SqlException
SqlException
public boolean flowAutoCommit() throws SqlException
SqlException
public boolean willAutoCommitGenerateFlow() throws SqlException
SqlException
void writeAutoCommit() throws SqlException
SqlException
void writeCommit() throws SqlException
SqlException
void readAutoCommit() throws SqlException
SqlException
void readCommit() throws SqlException
SqlException
public void rollback() throws java.sql.SQLException
rollback
in interface java.sql.Connection
java.sql.SQLException
protected void flowRollback() throws SqlException
SqlException
private void writeRollback() throws SqlException
SqlException
private void readRollback() throws SqlException
SqlException
public void close() throws java.sql.SQLException
close
in interface java.lang.AutoCloseable
close
in interface java.sql.Connection
java.sql.SQLException
void checkForTransactionInProgress() throws SqlException
SqlException
- if the connection cannot be closed because the
transaction is activepublic boolean transactionInProgress()
true
if the connection cannot be closed due to
uncommitted operations in the transactionprivate void closeX() throws java.sql.SQLException
java.sql.SQLException
public void closeResources() throws java.sql.SQLException
java.sql.SQLException
private void closeResourcesX() throws java.sql.SQLException
java.sql.SQLException
protected abstract boolean isGlobalPending_()
void closeForReuse(boolean statementPooling) throws SqlException
SqlException
private void flowClose() throws SqlException
SqlException
protected abstract void markClosed_()
private void markClosed(boolean statementPooling)
private void markClosedForReuse(boolean statementPooling)
private void markStatementsClosed()
private void writeCloseStatements() throws SqlException
SqlException
private void readCloseStatements() throws SqlException
SqlException
public boolean isPhysicalConnClosed()
public boolean isClosed()
isClosed
in interface java.sql.Connection
public boolean isClosedX()
public void setTransactionIsolation(int level) throws java.sql.SQLException
setTransactionIsolation
in interface java.sql.Connection
java.sql.SQLException
private void setTransactionIsolationX(int level) throws SqlException
If this method is called during a transaction, the result is implementation-defined.
Information about Derby specific isolation level handling:
SqlException
protected abstract boolean supportsSessionDataCaching()
protected abstract boolean serverSupportsLocators()
true
if LOB locators are supported.protected abstract boolean serverSupportsTimestampNanoseconds()
public int getTransactionIsolation() throws java.sql.SQLException
getTransactionIsolation
in interface java.sql.Connection
java.sql.SQLException
public int getTransactionIsolationX() throws java.sql.SQLException
java.sql.SQLException
public int getTransactionID()
public java.lang.String getCurrentSchemaName() throws java.sql.SQLException
java.sql.SQLException
private int translateIsolation(java.lang.String isolationStr)
isolationStr
- SQL isolation stringpublic java.sql.SQLWarning getWarnings() throws java.sql.SQLException
getWarnings
in interface java.sql.Connection
java.sql.SQLException
public void clearWarnings() throws java.sql.SQLException
clearWarnings
in interface java.sql.Connection
java.sql.SQLException
private void clearWarningsX() throws SqlException
SqlException
public java.sql.DatabaseMetaData getMetaData() throws java.sql.SQLException
getMetaData
in interface java.sql.Connection
java.sql.SQLException
public void setReadOnly(boolean readOnly) throws java.sql.SQLException
setReadOnly
in interface java.sql.Connection
java.sql.SQLException
public boolean isReadOnly() throws java.sql.SQLException
isReadOnly
in interface java.sql.Connection
java.sql.SQLException
public void setCatalog(java.lang.String catalog) throws java.sql.SQLException
setCatalog
in interface java.sql.Connection
java.sql.SQLException
public java.lang.String getCatalog() throws java.sql.SQLException
getCatalog
in interface java.sql.Connection
java.sql.SQLException
public java.sql.Statement createStatement(int resultSetType, int resultSetConcurrency) throws java.sql.SQLException
createStatement
in interface java.sql.Connection
java.sql.SQLException
public java.sql.PreparedStatement prepareStatement(java.lang.String sql, int resultSetType, int resultSetConcurrency) throws java.sql.SQLException
prepareStatement
in interface java.sql.Connection
java.sql.SQLException
public java.sql.CallableStatement prepareCall(java.lang.String sql, int resultSetType, int resultSetConcurrency) throws java.sql.SQLException
prepareCall
in interface java.sql.Connection
java.sql.SQLException
ClientCallableStatement prepareMessageProc(java.lang.String sql) throws SqlException
SqlException
private int downgradeResultSetType(int resultSetType)
public java.util.Map<java.lang.String,java.lang.Class<?>> getTypeMap() throws java.sql.SQLException
getTypeMap
in interface java.sql.Connection
java.sql.SQLException
public void setTypeMap(java.util.Map map) throws java.sql.SQLException
setTypeMap
in interface java.sql.Connection
java.sql.SQLException
public void setHoldability(int holdability) throws java.sql.SQLException
setHoldability
in interface java.sql.Connection
java.sql.SQLException
public int getHoldability() throws java.sql.SQLException
getHoldability
in interface java.sql.Connection
java.sql.SQLException
public java.sql.Savepoint setSavepoint() throws java.sql.SQLException
setSavepoint
in interface java.sql.Connection
java.sql.SQLException
public java.sql.Savepoint setSavepoint(java.lang.String name) throws java.sql.SQLException
setSavepoint
in interface java.sql.Connection
java.sql.SQLException
private ClientSavepoint setSavepointX(ClientSavepoint savepoint) throws java.sql.SQLException
java.sql.SQLException
public void rollback(java.sql.Savepoint savepoint) throws java.sql.SQLException
rollback
in interface java.sql.Connection
java.sql.SQLException
public void releaseSavepoint(java.sql.Savepoint savepoint) throws java.sql.SQLException
releaseSavepoint
in interface java.sql.Connection
java.sql.SQLException
public java.sql.Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws java.sql.SQLException
createStatement
in interface java.sql.Connection
java.sql.SQLException
private ClientStatement createStatementX(int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SqlException
SqlException
protected void resetStatement(ClientStatement s) throws SqlException
SqlException
public java.sql.PreparedStatement prepareStatement(java.lang.String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws java.sql.SQLException
prepareStatement
in interface java.sql.Connection
java.sql.SQLException
ClientPreparedStatement prepareStatementX(java.lang.String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability, int autoGeneratedKeys, java.lang.String[] columnNames, int[] columnIndexes) throws SqlException
SqlException
protected void resetPrepareStatement(ClientPreparedStatement ps) throws SqlException
SqlException
public java.sql.CallableStatement prepareCall(java.lang.String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws java.sql.SQLException
prepareCall
in interface java.sql.Connection
java.sql.SQLException
ClientCallableStatement prepareCallX(java.lang.String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SqlException
SqlException
protected void resetPrepareCall(ClientCallableStatement cs) throws SqlException
SqlException
public java.sql.PreparedStatement prepareStatement(java.lang.String sql, int autoGeneratedKeys) throws java.sql.SQLException
prepareStatement
in interface java.sql.Connection
java.sql.SQLException
public java.sql.PreparedStatement prepareStatement(java.lang.String sql, int[] columnIndexes) throws java.sql.SQLException
prepareStatement
in interface java.sql.Connection
java.sql.SQLException
public java.sql.PreparedStatement prepareStatement(java.lang.String sql, java.lang.String[] columnNames) throws java.sql.SQLException
prepareStatement
in interface java.sql.Connection
java.sql.SQLException
protected abstract boolean allowCloseInUOW_()
protected abstract boolean doCloseStatementsOnClose_()
public abstract SectionManager newSectionManager(Agent agent)
protected abstract Agent newAgent_(LogWriter logWriter, int loginTimeout, java.lang.String serverName, int portNumber, int clientSSLMode) throws SqlException
SqlException
protected abstract ClientDatabaseMetaData newDatabaseMetaData_()
protected abstract ClientStatement newStatement_(int type, int concurrency, int holdability) throws SqlException
SqlException
protected abstract void resetStatement_(ClientStatement statement, int type, int concurrency, int holdability) throws SqlException
SqlException
protected abstract ClientPreparedStatement newPositionedUpdatePreparedStatement_(java.lang.String sql, Section section) throws SqlException
SqlException
protected abstract ClientPreparedStatement newPreparedStatement_(java.lang.String sql, int type, int concurrency, int holdability, int autoGeneratedKeys, java.lang.String[] columnNames, int[] columnIndexes) throws SqlException
SqlException
protected abstract void resetPreparedStatement_(ClientPreparedStatement ps, java.lang.String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability, int autoGeneratedKeys, java.lang.String[] columnNames, int[] columnIndexes) throws SqlException
SqlException
protected abstract ClientCallableStatement newCallableStatement_(java.lang.String sql, int type, int concurrency, int holdability) throws SqlException
SqlException
protected abstract void resetCallableStatement_(ClientCallableStatement cs, java.lang.String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SqlException
SqlException
public final void completeConnect() throws SqlException
SqlException
public abstract void writeCommitSubstitute_() throws SqlException
SqlException
public abstract void readCommitSubstitute_() throws SqlException
SqlException
public abstract void writeLocalXAStart_() throws SqlException
SqlException
public abstract void readLocalXAStart_() throws SqlException
SqlException
public abstract void writeLocalXACommit_() throws SqlException
SqlException
protected abstract void writeXACommit_() throws SqlException
SqlException
public abstract void readLocalXACommit_() throws SqlException
SqlException
protected abstract void readXACommit_() throws SqlException
SqlException
public abstract void writeLocalCommit_() throws SqlException
SqlException
public abstract void readLocalCommit_() throws SqlException
SqlException
protected abstract void writeXATransactionStart(ClientStatement statement) throws SqlException
SqlException
public void completeLocalCommit()
completeLocalCommit
in interface ConnectionCallbackInterface
public abstract void writeLocalRollback_() throws SqlException
SqlException
public abstract void readLocalRollback_() throws SqlException
SqlException
public void completeLocalRollback()
completeLocalRollback
in interface ConnectionCallbackInterface
private void completeSpecificRollback(UnitOfWorkListener uwl)
uwl
- The UnitOfWorkLitener to be rolled backpublic abstract void writeLocalXARollback_() throws SqlException
SqlException
protected abstract void writeXARollback_() throws SqlException
SqlException
public abstract void readLocalXARollback_() throws SqlException
SqlException
protected abstract void readXARollback_() throws SqlException
SqlException
public void writeTransactionStart(ClientStatement statement) throws SqlException
SqlException
public void readTransactionStart() throws SqlException
SqlException
void completeTransactionStart()
public void completeAbnormalUnitOfWork()
completeAbnormalUnitOfWork
in interface ConnectionCallbackInterface
public void completeAbnormalUnitOfWork(UnitOfWorkListener uwl)
completeAbnormalUnitOfWork
in interface ConnectionCallbackInterface
uwl
- The UnitOfWorkListener to be rolled back.public void completeChainBreakingDisconnect()
completeChainBreakingDisconnect
in interface ConnectionCallbackInterface
public void completeSqlca(Sqlca sqlca)
completeSqlca
in interface ConnectionCallbackInterface
public void completePiggyBackIsolation(int pbIsolation)
ConnectionCallbackInterface
completePiggyBackIsolation
in interface ConnectionCallbackInterface
pbIsolation
- new isolation level from the serverpublic void completeInitialPiggyBackIsolation(int pbIsolation)
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.
pbIsolation
- isolation level as specified by
java.sql.Connection
public void completePiggyBackSchema(java.lang.String pbSchema)
ConnectionCallbackInterface
completePiggyBackSchema
in interface ConnectionCallbackInterface
pbSchema
- new current schema from the serverpublic void completeInitialPiggyBackSchema(java.lang.String pbSchema)
pbSchema
- the schema namepublic void reset(LogWriter logWriter) throws SqlException
SqlException
public void lightReset() throws SqlException
SqlException
protected abstract void reset_(LogWriter logWriter) throws SqlException
SqlException
protected void completeReset(boolean isDeferredReset, boolean closeStatementsOnClose, NetXAResource xares) throws SqlException
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.
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.SqlException
CallableLocatorProcedures locatorProcedureCall()
connection.locatorProcedureCall().blobReleaseLocator(locator);
protected void checkForClosedConnection() throws SqlException
SqlException
public boolean isXAConnection()
public int getXAState()
public void setXAState(int state)
private void accumulateWarning(SqlWarning e)
void accumulate440WarningForMessageProcFailure(SqlWarning e)
void accumulate444WarningForMessageProcFailure(SqlWarning e)
public int getServerVersion()
final int holdability()
public java.sql.Clob createClob() throws java.sql.SQLException
Clob
interface.
The object returned initially contains no data.createClob
in interface java.sql.Connection
Clob
interfacejava.sql.SQLException
- if an object that implements the
Clob
interface can not be constructed.public java.sql.Blob createBlob() throws java.sql.SQLException
Blob
interface.
The object returned initially contains no data.createBlob
in interface java.sql.Connection
Blob
interfacejava.sql.SQLException
- if an object that implements the
Blob interface can not be constructed.public boolean isAborting()
protected void beginAborting()
public java.lang.String getSchema() throws java.sql.SQLException
getSchema
in interface java.sql.Connection
java.sql.SQLException
public void setSchema(java.lang.String schemaName) throws java.sql.SQLException
setSchema
in interface java.sql.Connection
java.sql.SQLException
public void abort(java.util.concurrent.Executor executor) throws java.sql.SQLException
abort
in interface java.sql.Connection
java.sql.SQLException
public int getNetworkTimeout() throws java.sql.SQLException
getNetworkTimeout
in interface java.sql.Connection
java.sql.SQLException
public void setNetworkTimeout(java.util.concurrent.Executor executor, int milliseconds) throws java.sql.SQLException
setNetworkTimeout
in interface java.sql.Connection
java.sql.SQLException
Apache Derby V10.14 Internals - Copyright © 2004,2018 The Apache Software Foundation. All Rights Reserved.