Package oracle.jdbc.replay
Interface OracleDataSource
-
- All Superinterfaces:
javax.sql.CommonDataSource,javax.sql.DataSource,OracleCommonDataSource,OracleDataSource,java.sql.Wrapper
- All Known Subinterfaces:
OracleConnectionPoolDataSource,OracleXADataSource
- All Known Implementing Classes:
OracleConnectionPoolDataSource,OracleConnectionPoolDataSource,OracleConnectionPoolDataSourceImpl,OracleDataSource,OracleDataSource,OracleDataSourceImpl,OracleOCIConnectionPool,OracleXADataSource,OracleXADataSource,OracleXADataSourceImpl
public interface OracleDataSource extends OracleDataSource
A data source that supports transparent failover replay of JDBC operations.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringCONNECTION_PROPERTIESstatic java.lang.StringDATA_SOURCE_NAMEstatic java.lang.StringDATABASE_NAMEstatic java.lang.StringDESCRIPTIONstatic java.lang.StringEXPLICIT_CACHING_ENABLEDstatic java.lang.StringIMPLICIT_CACHING_ENABLEDstatic java.lang.StringMAX_STATEMENTSstatic java.lang.StringNETWORK_PROTOCOLstatic java.lang.StringPASSWORDstatic java.lang.StringPORT_NUMBERstatic java.lang.StringROLE_NAMEstatic java.lang.StringSERVER_NAMEstatic java.lang.StringURLstatic java.lang.StringUSER
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidclearReplayStatistics()Clears replay statistics accumulated so far on all connection created by this data source.oracle.jdbc.replay.internal.ConnectionInitializationCallbackgetConnectionInitializationCallback()Obtains the registered connection initialization callback, if any.booleangetExplicitCachingEnabled()Returns the current value of the explicitCachingEnabled property.booleangetImplicitCachingEnabled()getImplicitCachingEnabled Returns the current value of the implicitCachingEnabled property.intgetMaxStatements()Returns the current value of the maxStatements property.ReplayStatisticsgetReplayStatistics()Obtains replay statistics accumulated so far.java.lang.StringgetRoleName()Gets the data source role name.voidregisterConnectionInitializationCallback(oracle.jdbc.replay.internal.ConnectionInitializationCallback cbk)Registers a connection initialization callback.voidsetExplicitCachingEnabled(boolean cache)Sets the value of the explicitCachingEnabled property, which enables or disables the explicit cache.voidsetImplicitCachingEnabled(boolean cache)Sets the value of the implicitCachingEnabled property, which enables or disables the implicit statement cache.voidsetMaxStatements(int max)Specifies the value of the maxStatements property.voidsetRoleName(java.lang.String roleName)Sets the data source role name.voidunregisterConnectionInitializationCallback(oracle.jdbc.replay.internal.ConnectionInitializationCallback cbk)Unregisters a specified connection initialization callback.-
Methods inherited from interface javax.sql.DataSource
getConnection, getConnection, getLoginTimeout, getLogWriter, setLoginTimeout, setLogWriter
-
Methods inherited from interface oracle.jdbc.datasource.OracleCommonDataSource
createShardingKeyBuilder, getConnectionProperties, getConnectionProperty, getDatabaseName, getDataSourceName, getDescription, getNetworkProtocol, getPortNumber, getServerName, getURL, getUser, setConnectionProperties, setConnectionProperty, setDatabaseName, setDataSourceName, setDescription, setHostnameResolver, setNetworkProtocol, setPassword, setPortNumber, setServerName, setSingleShardTransactionSupport, setSSLContext, setTokenSupplier, setURL, setUser
-
Methods inherited from interface oracle.jdbc.datasource.OracleDataSource
createConnectionBuilder
-
-
-
-
Field Detail
-
USER
static final java.lang.String USER
- See Also:
- Constant Field Values
-
URL
static final java.lang.String URL
- See Also:
- Constant Field Values
-
PASSWORD
static final java.lang.String PASSWORD
- See Also:
- Constant Field Values
-
SERVER_NAME
static final java.lang.String SERVER_NAME
- See Also:
- Constant Field Values
-
PORT_NUMBER
static final java.lang.String PORT_NUMBER
- See Also:
- Constant Field Values
-
DATABASE_NAME
static final java.lang.String DATABASE_NAME
- See Also:
- Constant Field Values
-
DATA_SOURCE_NAME
static final java.lang.String DATA_SOURCE_NAME
- See Also:
- Constant Field Values
-
DESCRIPTION
static final java.lang.String DESCRIPTION
- See Also:
- Constant Field Values
-
NETWORK_PROTOCOL
static final java.lang.String NETWORK_PROTOCOL
- See Also:
- Constant Field Values
-
ROLE_NAME
static final java.lang.String ROLE_NAME
- See Also:
- Constant Field Values
-
CONNECTION_PROPERTIES
static final java.lang.String CONNECTION_PROPERTIES
- See Also:
- Constant Field Values
-
MAX_STATEMENTS
static final java.lang.String MAX_STATEMENTS
- See Also:
- Constant Field Values
-
IMPLICIT_CACHING_ENABLED
static final java.lang.String IMPLICIT_CACHING_ENABLED
- See Also:
- Constant Field Values
-
EXPLICIT_CACHING_ENABLED
static final java.lang.String EXPLICIT_CACHING_ENABLED
- See Also:
- Constant Field Values
-
-
Method Detail
-
setRoleName
void setRoleName(java.lang.String roleName) throws java.sql.SQLExceptionSets the data source role name.- Specified by:
setRoleNamein interfaceOracleCommonDataSource- Parameters:
roleName- data source role name to be set.- Throws:
java.sql.SQLException
-
getRoleName
java.lang.String getRoleName()
Gets the data source role name.- Specified by:
getRoleNamein interfaceOracleCommonDataSource- Returns:
- data source role name.
-
registerConnectionInitializationCallback
void registerConnectionInitializationCallback(oracle.jdbc.replay.internal.ConnectionInitializationCallback cbk) throws java.sql.SQLExceptionRegisters a connection initialization callback.- Parameters:
cbk- TheConnectionInitializationCallbackobject to be registered.- Throws:
java.sql.SQLException- If there is a callback already registered with the pool.
-
unregisterConnectionInitializationCallback
void unregisterConnectionInitializationCallback(oracle.jdbc.replay.internal.ConnectionInitializationCallback cbk) throws java.sql.SQLExceptionUnregisters a specified connection initialization callback.- Parameters:
cbk- TheConnectionInitializationCallbackobject to be unregistered.- Throws:
java.sql.SQLException- If callback removal fails.
-
getConnectionInitializationCallback
oracle.jdbc.replay.internal.ConnectionInitializationCallback getConnectionInitializationCallback()
Obtains the registered connection initialization callback, if any.- Returns:
- The registered
ConnectionInitializationCallback, or null if there is no callback registered.
-
setMaxStatements
void setMaxStatements(int max) throws java.sql.SQLExceptionSpecifies the value of the maxStatements property. This is the size of the statement cache used by both implicit and explicit caching. This value does not apply to the statement cache size of connections created by ImplicitStatementCache for which the cache size is set through a java.util.Properties object.- Specified by:
setMaxStatementsin interfaceOracleCommonDataSource- Parameters:
max- Requested size of the cache. If the existing cache size is less than max, statements will be purged to reduce the size.- Throws:
java.sql.SQLException- if max < 0
-
getMaxStatements
int getMaxStatements() throws java.sql.SQLExceptionReturns the current value of the maxStatements property.- Specified by:
getMaxStatementsin interfaceOracleCommonDataSource- Throws:
java.sql.SQLException
-
setImplicitCachingEnabled
void setImplicitCachingEnabled(boolean cache) throws java.sql.SQLExceptionSets the value of the implicitCachingEnabled property, which enables or disables the implicit statement cache. Note that this is independent of the cache size that is set with setMaxStatements().- Specified by:
setImplicitCachingEnabledin interfaceOracleCommonDataSource- Parameters:
cache- If true, then implicit caching is enabled. If false, then any existing statement is purged and the implicit caching is disabled.- Throws:
java.sql.SQLException
-
getImplicitCachingEnabled
boolean getImplicitCachingEnabled() throws java.sql.SQLExceptiongetImplicitCachingEnabled Returns the current value of the implicitCachingEnabled property.- Specified by:
getImplicitCachingEnabledin interfaceOracleCommonDataSource- Throws:
java.sql.SQLException
-
setExplicitCachingEnabled
void setExplicitCachingEnabled(boolean cache) throws java.sql.SQLExceptionSets the value of the explicitCachingEnabled property, which enables or disables the explicit cache. Note that this is independent of the cache size, which is set with setMaxStatements().- Specified by:
setExplicitCachingEnabledin interfaceOracleCommonDataSource- Parameters:
cache- If true, then explicit caching is enabled. If false, then any existing statement is purged and the explicit caching is disabled.- Throws:
java.sql.SQLException- if called on a logical connection.
-
getExplicitCachingEnabled
boolean getExplicitCachingEnabled() throws java.sql.SQLExceptionReturns the current value of the explicitCachingEnabled property.- Specified by:
getExplicitCachingEnabledin interfaceOracleCommonDataSource- Throws:
java.sql.SQLException
-
getReplayStatistics
ReplayStatistics getReplayStatistics()
Obtains replay statistics accumulated so far. These reflect replay actions across all the connections created by this data source. It is recommended that this call be made when the connections are quiescent and there are few new connections being opened.- Returns:
- A replay statistics object containing all the metrics.
-
clearReplayStatistics
void clearReplayStatistics()
Clears replay statistics accumulated so far on all connection created by this data source. It is recommended that this call be made when the connections are quiescent and there are few new connections being opened.
-
-