Class OracleDataSource
- java.lang.Object
- 
- oracle.jdbc.datasource.impl.OracleDataSource
 
- 
- All Implemented Interfaces:
- Serializable,- Wrapper,- Referenceable,- CommonDataSource,- DataSource,- OracleCommonDataSource,- OracleDataSource,- oracle.jdbc.internal.Monitor,- oracle.jdbc.replay.internal.OracleDataSource,- OracleDataSource
 - Direct Known Subclasses:
- OracleConnectionPoolDataSource,- OracleDataSource,- OracleDataSourceImpl
 
 public class OracleDataSource extends Object implements OracleDataSource, oracle.jdbc.replay.internal.OracleDataSource, Serializable, Referenceable, oracle.jdbc.internal.Monitor A DataSourceobject is a factory forConnectionobjects. An object that implements theDataSourceinterface will typically be registered with a JNDI service provider. A JDBC driver that is accessed via theDataSourceAPI does not automatically register itself with theDriverManager.This data Source supports Application Continuity (AC) and transparent JDBC operation replay upon a failover. To disable such feature, set "oracle.jdbc.enableACSupport"to false either as a Java system property, or as a connection property on this data source.The following example illustrates the use of this data source to create a JDBC connection: oracle.jdbc.datasource.OracleDataSource ods = new oracle.jdbc.datasource.impl.OracleDataSource(); ods.setURL("jdbc:oracle:thin:@//dbhost:dbport/dbservice"); ods.setUser("User"); ods.setPassword("Passwd"); ods.setConnectionProperty("connProp1", "value1"); ods.setConnectionProperty("connProp2", "value2"); Connection conn = ods.getConnection();The following example illustrates the use of a connection obtained from this data source for Application Continuity protection: oracle.jdbc.OracleConnection conn = (oracle.jdbc.OracleConnection) ods.getConnection(); conn.beginRequest(); ...... // JDBC calls protected by AC conn.endRequest();- Since:
- 20c
- See Also:
- Serialized Form
 
- 
- 
Field Summary- 
Fields inherited from interface oracle.jdbc.replay.OracleDataSourceCONNECTION_PROPERTIES, DATA_SOURCE_NAME, DATABASE_NAME, DESCRIPTION, EXPLICIT_CACHING_ENABLED, IMPLICIT_CACHING_ENABLED, MAX_STATEMENTS, NETWORK_PROTOCOL, PASSWORD, PORT_NUMBER, ROLE_NAME, SERVER_NAME, URL, USER
 
- 
 - 
Constructor SummaryConstructors Constructor Description OracleDataSource()
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected voidaddRefProperties(Reference ref)static voidcleanup()voidclearDoneDumpOnMemoryPressure()voidclearReplayStatistics()Clears replay statistics accumulated so far on all connection created by this data source.OracleConnectionBuilderImplcreateConnectionBuilder()Creates a new instanceprotected voiddebug(Logger logger, Level level, Executable method, String msg)AC specifcprotected ConnectionenableACAndProxifyIfNecessary(Connection conn, OracleConnectionBuilderImpl connBuilder)protected voidfinalize()ConnectiongetConnection()Attempt to establish a database connection.ConnectiongetConnection(String user, String password)Attempt to establish a database connection.protected ConnectiongetConnection(String _user, oracle.jdbc.internal.OpaqueString _passwd)Attempt to establish a database connection.protected ConnectiongetConnection(OracleConnectionBuilderImpl builder)Attempt to establish a database connection.protected oracle.jdbc.internal.OracleConnectiongetConnectionDuringExceptionHandling()oracle.jdbc.replay.internal.ConnectionInitializationCallbackgetConnectionInitializationCallback()Obtains the registered connection initialization callback, if any.ConnectiongetConnectionNoProxy(OracleConnectionBuilderImpl connBuilder)PropertiesgetConnectionProperties()Gets the connection properties that are set on this data source object.StringgetConnectionProperty(String propertyName)Gets the specified connection property that is set on this data source.StringgetDatabaseName()Get the name of the database set on this DataSource instance.StringgetDataSourceName()Get the datasource name for this instance if set.StringgetDescription()Get the Desciption of this data source.StringgetDriverType()Get the Oracle JDBC driver type set for this datasource instancebooleangetExplicitCachingEnabled()getExplicitCachingEnabled Returns the current value of the explicitCachingEnabled property.booleangetImplicitCachingEnabled()getImplicitCachingEnabled Returns the current value of the implicitCachingEnabled property.intgetLoginTimeout()Gets the maximum time in seconds that this data source can wait while attempting to connect to a database.PrintWritergetLogWriter()Get the log writer for this data source.intgetMaxStatements()getMaxStatements Returns the current value of the maxStatements property.oracle.jdbc.internal.Monitor.CloseableLockgetMonitorLock()StringgetNetworkProtocol()Get the network protocol set.LoggergetParentLogger()protected oracle.jdbc.internal.OpaqueStringgetPassword()protected ConnectiongetPhysicalConnection(Properties prop, oracle.jdbc.internal.AbstractConnectionBuilder builder)Get a connection to the database specified by this datasource.intgetPortNumber()Get the port number on which server is listening for requests.oracle.jdbc.proxy.ProxyFactorygetProxyFactory()ReferencegetReference()ReplayStatisticsgetReplayStatistics()Obtains replay statistics accumulated so far.StringgetReplayStatisticsString()intgetRequestSizeLimit()StringgetRoleName()Gets the datasource role name.StringgetServerName()Get the name of the server on which database is running.StringgetServiceName()Get the service_name To distinguish services from instances, a new URL using service_name is added, existing url with SID will be supported, but deprecated.protected static StringgetSystemProperty(String property, String defaultValue)StringgetTNSEntryName()Get the TNS entry name for this instance if set.StringgetURL()Get the URL for this datasource.StringgetUser()Get the user name for this datasource.booleanisWrapperFor(Class<?> iface)Since this class is not a wrapper, just check to see if this implements the requested interface.protected voidmakeURL()voidregisterConnectionInitializationCallback(oracle.jdbc.replay.internal.ConnectionInitializationCallback cbk)Registers a ConnectionInitializationCallback with the data source.static voidregisterMBean()voidremoveReplayStatistics(oracle.jdbc.replay.internal.ReplayStatistics stats)voidsetConnectionProperties(Properties properties)Sets the Connection Properties for the datasourcevoidsetConnectionProperty(String name, String value)Sets a connection property on the data source.voidsetDatabaseName(String dbname)Set the name of a particular database on a server.voidsetDataSourceName(String dsname)Set the DataSourceName.voidsetDescription(String des)Set the Desciption for this data source instance.voidsetDriverType(String dt)Set the JDBC driver type.voidsetExplicitCachingEnabled(boolean cache)setExplicitCachingEnabled Sets the value of the explicitCachingEnabled property, which enables or disables the explicit cache.voidsetHostnameResolver(OracleHostnameResolver hostnameResolver)Sets a custom hostname resolver implementingOracleHostnameResolverused to provide a custom DNS name resolution strategy to locate the database host.voidsetImplicitCachingEnabled(boolean cache)setImplicitCachingEnabled Sets the value of the implicitCachingEnabled property, which enables or disables the implicit cache.voidsetLoginTimeout(int timeout)Sets the maximum time in seconds that this data source will wait while attempting to connect to a database.voidsetLogWriter(PrintWriter pw)Set the log writer for this data source.voidsetMaxStatements(int max)Deprecated.voidsetNetworkProtocol(String np)Set the network protocol for the connections.voidsetPassword(String pd)Set the password with which connections have to be obtained.voidsetPortNumber(int pn)Set the port number where a server is listening for requests.voidsetRoleName(String roleName)Sets the datasource role name.voidsetServerName(String sn)Set the name of the Server on which database is running.voidsetServiceName(String svcname)Set the service_name of a database on a server.voidsetSingleShardTransactionSupport(boolean allow)Sets single shard transaction support in auto commit OFF mode.voidsetSSLContext(SSLContext sslContext)Specifies aSSLContextto use as a factory for SSLEngine objects that carry out the TLS protocol.voidsetTNSEntryName(String dbname)Set the TNS entry name.voidsetTokenSupplier(java.util.function.Supplier<? extends AccessToken> tokenSupplier)Sets a supplier function that generates an access token when creating a connection with thisDataSource.protected voidsetupACSpecificProperties(boolean useProxy)voidsetURL(String url)Set the URL from which connections have to be obtained.voidsetUser(String userName)Set the user name with which connections have to be obtained.protected voidtrace(String s)voidunregisterConnectionInitializationCallback(oracle.jdbc.replay.internal.ConnectionInitializationCallback cbk)Removes the ConnectionInitializationCallback registered with the data source, if any.static voidunregisterMBean()<T> Tunwrap(Class<T> iface)Since this class is not a wrapper, just check to see if this implements the requested interface.voidupdateReplayStatistics(oracle.jdbc.replay.internal.ReplayStatistics newStats)- 
Methods inherited from class java.lang.Objectclone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface oracle.jdbc.internal.MonitoracquireCloseableLock, acquireLock, newDefaultLock, releaseLock
 - 
Methods inherited from interface oracle.jdbc.datasource.OracleCommonDataSourcecreateShardingKeyBuilder
 
- 
 
- 
- 
- 
Field Detail- 
DEFAULT_SERVICE_NAMEprotected static final String DEFAULT_SERVICE_NAME - See Also:
- Constant Field Values
 
 - 
logWriterprotected PrintWriter logWriter 
 - 
loginTimeoutprotected int loginTimeout 
 - 
databaseNameprotected String databaseName 
 - 
serviceNameprotected String serviceName 
 - 
dataSourceNameprotected String dataSourceName 
 - 
descriptionprotected String description 
 - 
networkProtocolprotected String networkProtocol 
 - 
portNumberprotected int portNumber 
 - 
userprotected String user 
 - 
passwordprotected oracle.jdbc.internal.OpaqueString password 
 - 
serverNameprotected String serverName 
 - 
urlprotected String url 
 - 
driverTypeprotected String driverType 
 - 
tnsEntryprotected String tnsEntry 
 - 
maxStatementsprotected int maxStatements 
 - 
implicitCachingEnabledprotected boolean implicitCachingEnabled 
 - 
explicitCachingEnabledprotected boolean explicitCachingEnabled 
 - 
maxStatementsSetprotected boolean maxStatementsSet 
 - 
implicitCachingEnabledSetprotected boolean implicitCachingEnabledSet 
 - 
explicitCachingEnabledSetprotected boolean explicitCachingEnabledSet 
 - 
connectionPropertiesprotected Properties connectionProperties 
 - 
isOracleDataSourcepublic boolean isOracleDataSource 
 - 
driverprotected transient oracle.jdbc.driver.OracleDriver driver 
 - 
isFirstConnectionprotected AtomicBoolean isFirstConnection 
 - 
RECONNECT_DELAY_PROPERTYprotected static final String RECONNECT_DELAY_PROPERTY - See Also:
- Constant Field Values
 
 - 
RECONNECT_RETRIES_PROPERTYprotected static final String RECONNECT_RETRIES_PROPERTY - See Also:
- Constant Field Values
 
 - 
reconnectDelayprotected int reconnectDelay 
 - 
reconnectRetriesprotected int reconnectRetries 
 - 
FAILOVER_TYPE_PROPERTYprotected static final String FAILOVER_TYPE_PROPERTY - See Also:
- Constant Field Values
 
 - 
FAILOVER_TYPE_TRANSACTIONprotected static final int FAILOVER_TYPE_TRANSACTION - See Also:
- Constant Field Values
 
 - 
SESSION_STATE_CONSISTENCY_STATICprotected static final int SESSION_STATE_CONSISTENCY_STATIC - See Also:
- Constant Field Values
 
 - 
FAILOVER_TYPE_AUTOprotected static final int FAILOVER_TYPE_AUTO - See Also:
- Constant Field Values
 
 - 
isTransactionReplayEnabledprotected boolean isTransactionReplayEnabled 
 - 
isAutoACEnabledprotected boolean isAutoACEnabled 
 - 
SESSION_STATE_PROPERTYprotected static final String SESSION_STATE_PROPERTY - See Also:
- Constant Field Values
 
 - 
isReplayInDynamicModeprotected boolean isReplayInDynamicMode 
 - 
FAILOVER_RESTORE_PROPERTYprotected static final String FAILOVER_RESTORE_PROPERTY - See Also:
- Constant Field Values
 
 - 
FAILOVER_RESTORE_NONEprotected static final int FAILOVER_RESTORE_NONE - See Also:
- Constant Field Values
 
 - 
FAILOVER_RESTORE_LEVEL1protected static final int FAILOVER_RESTORE_LEVEL1 - See Also:
- Constant Field Values
 
 - 
FAILOVER_RESTORE_LEVEL2protected static final int FAILOVER_RESTORE_LEVEL2 - See Also:
- Constant Field Values
 
 - 
FAILOVER_RESTORE_AUTOprotected static final int FAILOVER_RESTORE_AUTO - See Also:
- Constant Field Values
 
 - 
stateRestorationTypeprotected oracle.jdbc.replay.internal.ReplayableConnection.StateRestorationType stateRestorationType 
 - 
isStateRestorationAutoprotected boolean isStateRestorationAuto 
 - 
INITIATION_TIMEOUT_PROPERTYprotected static final String INITIATION_TIMEOUT_PROPERTY - See Also:
- Constant Field Values
 
 - 
replayInitiationTimeoutprotected int replayInitiationTimeout 
 - 
CHECKSUM_PROPERTYprotected static final String CHECKSUM_PROPERTY - See Also:
- Constant Field Values
 
 - 
clientChecksum12xprotected final String clientChecksum12x 
 - 
clientChecksum11203xprotected final String clientChecksum11203x 
 - 
IGNORE_AC_CONTEXT_PROPERTYprotected static final String IGNORE_AC_CONTEXT_PROPERTY - See Also:
- Constant Field Values
 
 - 
ENABLE_AC_SUPPORT_PROPERTYprotected static final String ENABLE_AC_SUPPORT_PROPERTY - See Also:
- Constant Field Values
 
 - 
REQUEST_SIZE_LIMIT_PROPERTYprotected static final String REQUEST_SIZE_LIMIT_PROPERTY - See Also:
- Constant Field Values
 
 - 
doneDumpOnMemoryPressureprotected AtomicBoolean doneDumpOnMemoryPressure 
 - 
TRACEpublic static final boolean TRACE - See Also:
- Constant Field Values
 
 
- 
 - 
Constructor Detail- 
OracleDataSourcepublic OracleDataSource() throws SQLException- Throws:
- SQLException
 
 
- 
 - 
Method Detail- 
getConnectionpublic Connection getConnection() throws SQLException Attempt to establish a database connection. - Specified by:
- getConnectionin interface- DataSource
- Returns:
- a Connection to the database
- Throws:
- SQLException- if a database-access error occurs.
 
 - 
getConnectionpublic Connection getConnection(String user, String password) throws SQLException Attempt to establish a database connection. - Specified by:
- getConnectionin interface- DataSource
- Parameters:
- user- the database user on whose behalf the Connection is being made
- password- the user's password
- Returns:
- a Connection to the database
- Throws:
- SQLException- if a database-access error occurs.
 
 - 
getConnectionprotected Connection getConnection(String _user, oracle.jdbc.internal.OpaqueString _passwd) throws SQLException Attempt to establish a database connection. - Parameters:
- _user- the database user on whose behalf the Connection is being made
- _passwd- the user's password
- Returns:
- a Connection to the database
- Throws:
- SQLException- if a database-access error occurs.
 
 - 
getConnectionprotected Connection getConnection(OracleConnectionBuilderImpl builder) throws SQLException Attempt to establish a database connection. - Parameters:
- builder- Builder which has the required properties set for building the connection
- Returns:
- a Connection to the database
- Throws:
- SQLException- if a database-access error occurs.
 
 - 
getPhysicalConnectionprotected Connection getPhysicalConnection(Properties prop, oracle.jdbc.internal.AbstractConnectionBuilder builder) throws SQLException Get a connection to the database specified by this datasource.- Parameters:
- prop- Connection properties specified on this datasource.
- builder- The builder object used to create the connection. May be null if a builder was not used to create the connection.
- Returns:
- A database connection
- Throws:
- SQLException
 
 - 
getLoginTimeoutpublic int getLoginTimeout() Gets the maximum time in seconds that this data source can wait while attempting to connect to a database. A value of zero means that the timeout is the default system timeout if there is one; otherwise it means that there is no timeout. When a DataSource object is created the login timeout is initially zero.- Specified by:
- getLoginTimeoutin interface- CommonDataSource
- Specified by:
- getLoginTimeoutin interface- DataSource
- Returns:
- the data source login time limit
- Throws:
- SQLException- if a database access error occurs.
 
 - 
setLoginTimeoutpublic void setLoginTimeout(int timeout) Sets the maximum time in seconds that this data source will wait while attempting to connect to a database. A value of zero specifies that the timeout is the default system timeout if there is one; otherwise it specifies that there is no timeout. When a DataSource object is created the login timeout is initially zero. - Specified by:
- setLoginTimeoutin interface- CommonDataSource
- Specified by:
- setLoginTimeoutin interface- DataSource
- Parameters:
- seconds- the data source login time limit
- Throws:
- SQLException- if a database access error occurs.
 
 - 
setLogWriterpublic void setLogWriter(PrintWriter pw) Set the log writer for this data source. The log writer is a character output stream to which all logging and tracing messages for this data source object instance will be printed. This includes messages printed by the methods of this object, messages printed by methods of other objects manufactured by this object, and so on. Messages printed to a data source specific log writer are not printed to the log writer associated with the java.sql.Drivermanager class. When a DataSource object is created the log writer is initially null, in other words, logging is disabled. - Specified by:
- setLogWriterin interface- CommonDataSource
- Specified by:
- setLogWriterin interface- DataSource
- Parameters:
- out- the new log writer; to disable, set to null
- Throws:
- SQLException- if a database-access error occurs.
 
 - 
getLogWriterpublic PrintWriter getLogWriter() Get the log writer for this data source. The log writer is a character output stream to which all logging and tracing messages for this data source object instance will be printed. This includes messages printed by the methods of this object, messages printed by methods of other objects manufactured by this object, and so on. Messages printed to a data source specific log writer are not printed to the log writer associated with the java.sql.Drivermanager class. When a DataSource object is created the log writer is initially null, in other words, logging is disabled. - Specified by:
- getLogWriterin interface- CommonDataSource
- Specified by:
- getLogWriterin interface- DataSource
- Returns:
- the log writer for this data source, null if disabled
- Throws:
- SQLException- if a database-access error occurs.
 
 - 
setTNSEntryNamepublic void setTNSEntryName(String dbname) Set the TNS entry name. Works only for JDBC OCI driver. Assumed that client side Oracle in installed and TNS_ADMIN env variable is set. If URL is set, this property will be ignored.- Parameters:
- dbname- tns entry name
 
 - 
getTNSEntryNamepublic String getTNSEntryName() Get the TNS entry name for this instance if set. Returns null if not set.- Returns:
- TNS entry name
 
 - 
setDataSourceNamepublic void setDataSourceName(String dsname) Set the DataSourceName. Users need not set this as it will be set set automatically depending upon the instance created. Returns OracleDataSource for an OracleDataSource instance. Returns OracleXADataSource for an OracleXADataSource instance.- Specified by:
- setDataSourceNamein interface- OracleCommonDataSource
- Parameters:
- dsname- DataSource Name to be set.
 
 - 
getDataSourceNamepublic String getDataSourceName() Get the datasource name for this instance if set. Returns null if not set.- Specified by:
- getDataSourceNamein interface- OracleCommonDataSource
- Returns:
- DaraSource name
 
 - 
getDatabaseNamepublic String getDatabaseName() Get the name of the database set on this DataSource instance.- Specified by:
- getDatabaseNamein interface- OracleCommonDataSource
- Returns:
- database name set on this instance or null if not set.
 
 - 
setDatabaseNamepublic void setDatabaseName(String dbname) Set the name of a particular database on a server. In Oracle's jargon this is called SID (System Identifier).If URL is set, this property will be ignored. - Specified by:
- setDatabaseNamein interface- OracleCommonDataSource
- Parameters:
- dsname- database name to be set.
 
 - 
setServiceNamepublic void setServiceName(String svcname) Set the service_name of a database on a server. If URL is set, this property will be ignored. To distinguish services from instances, a new URL using service_name is added, existing url with SID will be supported, but deprecated.- Parameters:
- svcname- service_name to be set.
 
 - 
getServiceNamepublic String getServiceName() Get the service_name To distinguish services from instances, a new URL using service_name is added, existing url with SID will be supported, but deprecated.- Returns:
- service_name assiciated with the instance or null if not set.
 
 - 
setServerNamepublic void setServerName(String sn) Set the name of the Server on which database is running. If URL is set, this property will be ignored.- Specified by:
- setServerNamein interface- OracleCommonDataSource
- Parameters:
- sn- server/host name to be set.
 
 - 
getServerNamepublic String getServerName() Get the name of the server on which database is running.- Specified by:
- getServerNamein interface- OracleCommonDataSource
- Returns:
- server name set on this instance or null if not set.
 
 - 
setURLpublic void setURL(String url) Set the URL from which connections have to be obtained. If URL is set all other properties like databasename, servername, portNumber, network protocol, tnsentry, and driver Type will be ignored.- Specified by:
- setURLin interface- OracleCommonDataSource
- Parameters:
- url- URL to be set.
 
 - 
getURLpublic String getURL() throws SQLException Get the URL for this datasource. Will return the default value "jdbc:oracle:oci8:@" if not set before.- Specified by:
- getURLin interface- OracleCommonDataSource
- Throws:
- SQLException
 
 - 
setUserpublic void setUser(String userName) Set the user name with which connections have to be obtained.- Specified by:
- setUserin interface- OracleCommonDataSource
- Parameters:
- user- Username to be set.
 
 - 
getUserpublic String getUser() Get the user name for this datasource. Will return the default value ("scott") if not set before.- Specified by:
- getUserin interface- OracleCommonDataSource
 
 - 
setPasswordpublic void setPassword(String pd) Set the password with which connections have to be obtained. The default value is "tiger".- Specified by:
- setPasswordin interface- OracleCommonDataSource
- Parameters:
- pd- Passowrd to be set.
 
 - 
getPasswordprotected oracle.jdbc.internal.OpaqueString getPassword() 
 - 
getDescriptionpublic String getDescription() Get the Desciption of this data source.- Specified by:
- getDescriptionin interface- OracleCommonDataSource
- Returns:
- Description that was set or will return null if not set.
 
 - 
setDescriptionpublic void setDescription(String des) Set the Desciption for this data source instance.- Specified by:
- setDescriptionin interface- OracleCommonDataSource
- Parameters:
- des- Desciption to be set.
 
 - 
getDriverTypepublic String getDriverType() Get the Oracle JDBC driver type set for this datasource instance- Returns:
- Driver Type that was set or null if not set.
 
 - 
setDriverTypepublic void setDriverType(String dt) Set the JDBC driver type. Possible values are thin, oci8, and kprb. If URL is set, this property will be ignored.If set to kprb, nothing else is needed to open a connection. This is meant for Server side JDBC driver when running inside server. If set to thin, serverName, portNumber and databaseName are need to open a connection. If set to oci, and network protocol is set to IPC or TNSEntryName is set then nothing else is needed. If not, serverName, portNumber and databaseName have to be provided. - Parameters:
- dt- Driver Type tp be set.
 
 - 
getNetworkProtocolpublic String getNetworkProtocol() Get the network protocol set.- Specified by:
- getNetworkProtocolin interface- OracleCommonDataSource
- Returns:
- network protocol that was set or null if not.
 
 - 
setNetworkProtocolpublic void setNetworkProtocol(String np) throws SQLException Set the network protocol for the connections. Default is "tcp". Can be set to all possible protocols Net8 supports. Only needed for JDBC OCI driver.- Specified by:
- setNetworkProtocolin interface- OracleCommonDataSource
- Parameters:
- np- set the network protocol to be used.
- Throws:
- SQLException
 
 - 
setPortNumberpublic void setPortNumber(int pn) Set the port number where a server is listening for requests. Not required when URL is set.- Specified by:
- setPortNumberin interface- OracleCommonDataSource
- Parameters:
- pn- port number on which server is listening
 
 - 
getPortNumberpublic int getPortNumber() Get the port number on which server is listening for requests.- Specified by:
- getPortNumberin interface- OracleCommonDataSource
- Returns:
- port number if set or null if not set.
 
 - 
getReferencepublic Reference getReference() throws NamingException - Specified by:
- getReferencein interface- Referenceable
- Throws:
- NamingException
 
 - 
addRefPropertiesprotected void addRefProperties(Reference ref) 
 - 
makeURLprotected void makeURL() throws SQLException- Throws:
- SQLException
 
 - 
traceprotected void trace(String s) 
 - 
setMaxStatementspublic void setMaxStatements(int max) throws SQLExceptionDeprecated.setMaxStatements Specifies the value of the maxStatements property. This will be the size of the application cache (which will be 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 java.util.Properties object.- Specified by:
- setMaxStatementsin interface- OracleCommonDataSource
- Specified by:
- setMaxStatementsin interface- OracleDataSource
- 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:
- SQLException- if max < 0
 
 - 
getMaxStatementspublic int getMaxStatements() throws SQLExceptiongetMaxStatements Returns the current value of the maxStatements property.- Specified by:
- getMaxStatementsin interface- OracleCommonDataSource
- Specified by:
- getMaxStatementsin interface- OracleDataSource
- Throws:
- SQLException
 
 - 
setImplicitCachingEnabledpublic void setImplicitCachingEnabled(boolean cache) throws SQLExceptionsetImplicitCachingEnabled Sets the value of the implicitCachingEnabled property, which enables or disables the implicit cache. Note that this is independent of the cache size, set with setMaxStatements().- Specified by:
- setImplicitCachingEnabledin interface- OracleCommonDataSource
- Specified by:
- setImplicitCachingEnabledin interface- OracleDataSource
- Parameters:
- cache- If true, then implicit caching will be enabled. If false, then any existing statements will be purged and the implicit cache will be disabled.
- Throws:
- SQLException
 
 - 
getImplicitCachingEnabledpublic boolean getImplicitCachingEnabled() throws SQLExceptiongetImplicitCachingEnabled Returns the current value of the implicitCachingEnabled property.- Specified by:
- getImplicitCachingEnabledin interface- OracleCommonDataSource
- Specified by:
- getImplicitCachingEnabledin interface- OracleDataSource
- Throws:
- SQLException
 
 - 
setExplicitCachingEnabledpublic void setExplicitCachingEnabled(boolean cache) throws SQLExceptionsetExplicitCachingEnabled Sets the value of the explicitCachingEnabled property, which enables or disables the explicit cache. Note that this is independent of the cache size, set with setMaxStatements().- Specified by:
- setExplicitCachingEnabledin interface- OracleCommonDataSource
- Specified by:
- setExplicitCachingEnabledin interface- OracleDataSource
- Parameters:
- cache- If true, then explicit caching will be enabled. If false, then any existing statements will be purged and the explicit cache will be disabled.
- Throws:
- SQLException- if called on a logical connection.
 
 - 
getExplicitCachingEnabledpublic boolean getExplicitCachingEnabled() throws SQLExceptiongetExplicitCachingEnabled Returns the current value of the explicitCachingEnabled property.- Specified by:
- getExplicitCachingEnabledin interface- OracleCommonDataSource
- Specified by:
- getExplicitCachingEnabledin interface- OracleDataSource
- Throws:
- SQLException
 
 - 
setConnectionPropertiespublic void setConnectionProperties(Properties properties) throws SQLException Sets the Connection Properties for the datasourceThe argument to this method is a Properties object. This properties object is used to create the connections returned by the receiver. The keys and values are Strings. The keys, values, and their meanings are defined in oracle.jdbc.OracleConnection. - Specified by:
- setConnectionPropertiesin interface- OracleCommonDataSource
- Parameters:
- properties- a Properties object with the desired connection property names and values.
- Throws:
- SQLException
- See Also:
- OracleConnection
 
 - 
setRoleNamepublic void setRoleName(String roleName) throws SQLException Sets the datasource role name.- Specified by:
- setRoleNamein interface- OracleCommonDataSource
- Specified by:
- setRoleNamein interface- OracleDataSource
- Parameters:
- roleName- datasource role name to be set.
- Throws:
- SQLException
 
 - 
getRoleNamepublic String getRoleName() Gets the datasource role name.- Specified by:
- getRoleNamein interface- OracleCommonDataSource
- Specified by:
- getRoleNamein interface- OracleDataSource
- Returns:
- datasource role name.
 
 - 
getConnectionPropertiespublic Properties getConnectionProperties() throws SQLException Gets the connection properties that are set on this data source object. These exclude any sensitive property with "password" in its name (case-insensitive); for example, "password", "oracle.net.websocketPassword", etc.- Specified by:
- getConnectionPropertiesin interface- OracleCommonDataSource
- Returns:
- A java.util.Properties object containing all the connection properties set on this data source object, excluding all sensitive properties described above. Null if there are no such connection properties set.
- Throws:
- SQLException- If any exception occurs while getting the connection properties.
 
 - 
getConnectionPropertypublic String getConnectionProperty(String propertyName) throws SQLException Gets the specified connection property that is set on this data source. Any sensitive property with "password" in its name (case-insensitive, for example, "password", "oracle.net.websocketPassword", etc.) is treated as if that property were not set.- Specified by:
- getConnectionPropertyin interface- OracleCommonDataSource
- Parameters:
- propertyName- The name of the specified connection property.
- Returns:
- The String value of the specified connection property. Null if there is no such connection property set, or the specified connection property has "password" in its name.
- Throws:
- SQLException- If any exception occurs while getting the connection property.
 
 - 
setConnectionPropertypublic void setConnectionProperty(String name, String value) throws SQLException Sets a connection property on the data source.- Specified by:
- setConnectionPropertyin interface- OracleCommonDataSource
- Parameters:
- name- The name of the connection property to be set.
- value- The value of the connection property to be set.
- Throws:
- SQLException- If any exception occurred while setting the connection property.
- See Also:
- setConnectionProperties(java.util.Properties)
 
 - 
isWrapperForpublic boolean isWrapperFor(Class<?> iface) throws SQLException Since this class is not a wrapper, just check to see if this implements the requested interface.- Specified by:
- isWrapperForin interface- Wrapper
- Parameters:
- iface- requested interface
- Returns:
- true iff this implements the requested interface
- Throws:
- SQLException- if the arg is not an interface
- Since:
- JDBC 4.0
 
 - 
unwrappublic <T> T unwrap(Class<T> iface) throws SQLException Since this class is not a wrapper, just check to see if this implements the requested interface. If it does return this.- Specified by:
- unwrapin interface- Wrapper
- Parameters:
- iface- requested interface
- Returns:
- this iff this implements the requested interface
- Throws:
- SQLException- if this does not implement the arg or the arg is not an interface
- Since:
- JDBC 4.0
 
 - 
getParentLoggerpublic Logger getParentLogger() throws SQLFeatureNotSupportedException - Specified by:
- getParentLoggerin interface- CommonDataSource
- Throws:
- SQLFeatureNotSupportedException
 
 - 
setSSLContextpublic final void setSSLContext(SSLContext sslContext) Description copied from interface:OracleCommonDataSourceSpecifies aSSLContextto use as a factory for SSLEngine objects that carry out the TLS protocol.The SSLContext must be initialized before establishing a connection to the data source. The certificates specified by that initialization will be used in place of any connection properties that would otherwise have specified certificates, such as key store and trust store property values. Specifying a null value will clear any non-null value that may have been set previously, causing this data source to behave as if this method had never been called at all. - Specified by:
- setSSLContextin interface- OracleCommonDataSource
- Parameters:
- sslContext- An SSLContext to use as an SSLEngine factory.
 
 - 
setSingleShardTransactionSupportpublic void setSingleShardTransactionSupport(boolean allow) throws SQLExceptionDescription copied from interface:OracleCommonDataSourceSets single shard transaction support in auto commit OFF mode. Default value is false. Only used for the sharding driver.- Specified by:
- setSingleShardTransactionSupportin interface- OracleCommonDataSource
- Throws:
- SQLException
 
 - 
setHostnameResolverpublic void setHostnameResolver(OracleHostnameResolver hostnameResolver) Description copied from interface:OracleCommonDataSourceSets a custom hostname resolver implementingOracleHostnameResolverused to provide a custom DNS name resolution strategy to locate the database host.- Specified by:
- setHostnameResolverin interface- OracleCommonDataSource
- Parameters:
- hostnameResolver- an OracleHostnameResolver to use when resolving the datasource hostname
 
 - 
getConnectionDuringExceptionHandlingprotected oracle.jdbc.internal.OracleConnection getConnectionDuringExceptionHandling() 
 - 
createConnectionBuilderpublic OracleConnectionBuilderImpl createConnectionBuilder() Creates a new instance- Specified by:
- createConnectionBuilderin interface- DataSource
- Specified by:
- createConnectionBuilderin interface- OracleDataSource
- Returns:
- The OracleConnectionBuilder instance that was created
 
 - 
getConnectionNoProxypublic Connection getConnectionNoProxy(OracleConnectionBuilderImpl connBuilder) throws SQLException - Specified by:
- getConnectionNoProxyin interface- oracle.jdbc.replay.internal.OracleDataSource
- Throws:
- SQLException
 
 - 
setupACSpecificPropertiesprotected void setupACSpecificProperties(boolean useProxy) throws SQLException- Throws:
- SQLException
 
 - 
enableACAndProxifyIfNecessaryprotected Connection enableACAndProxifyIfNecessary(Connection conn, OracleConnectionBuilderImpl connBuilder) throws SQLException - Throws:
- SQLException
 
 - 
registerConnectionInitializationCallbackpublic void registerConnectionInitializationCallback(oracle.jdbc.replay.internal.ConnectionInitializationCallback cbk) throws SQLExceptionRegisters a ConnectionInitializationCallback with the data source.- Specified by:
- registerConnectionInitializationCallbackin interface- OracleDataSource
- Parameters:
- cbk- The ConnectionInitializationCallback to be registered.
- Throws:
- SQLException- If the argument is null or callback registration fails.
 
 - 
unregisterConnectionInitializationCallbackpublic void unregisterConnectionInitializationCallback(oracle.jdbc.replay.internal.ConnectionInitializationCallback cbk) throws SQLExceptionRemoves the ConnectionInitializationCallback registered with the data source, if any.- Specified by:
- unregisterConnectionInitializationCallbackin interface- OracleDataSource
- Parameters:
- cbk- The- ConnectionInitializationCallbackobject to be unregistered.
- Throws:
- SQLException- If callback removal fails.
 
 - 
getConnectionInitializationCallbackpublic oracle.jdbc.replay.internal.ConnectionInitializationCallback getConnectionInitializationCallback() Description copied from interface:OracleDataSourceObtains the registered connection initialization callback, if any.- Specified by:
- getConnectionInitializationCallbackin interface- OracleDataSource
- Returns:
- The registered ConnectionInitializationCallback, or null if there is no callback registered.
 
 - 
getReplayStatisticspublic ReplayStatistics getReplayStatistics() Description copied from interface:OracleDataSourceObtains 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.- Specified by:
- getReplayStatisticsin interface- OracleDataSource
- Returns:
- A replay statistics object containing all the metrics.
 
 - 
clearDoneDumpOnMemoryPressurepublic void clearDoneDumpOnMemoryPressure() - Specified by:
- clearDoneDumpOnMemoryPressurein interface- oracle.jdbc.replay.internal.OracleDataSource
 
 - 
getReplayStatisticsStringpublic String getReplayStatisticsString() - Specified by:
- getReplayStatisticsStringin interface- oracle.jdbc.replay.internal.OracleDataSource
 
 - 
clearReplayStatisticspublic void clearReplayStatistics() Description copied from interface:OracleDataSourceClears 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.- Specified by:
- clearReplayStatisticsin interface- OracleDataSource
 
 - 
updateReplayStatisticspublic void updateReplayStatistics(oracle.jdbc.replay.internal.ReplayStatistics newStats) - Specified by:
- updateReplayStatisticsin interface- oracle.jdbc.replay.internal.OracleDataSource
 
 - 
removeReplayStatisticspublic void removeReplayStatistics(oracle.jdbc.replay.internal.ReplayStatistics stats) - Specified by:
- removeReplayStatisticsin interface- oracle.jdbc.replay.internal.OracleDataSource
 
 - 
getRequestSizeLimitpublic int getRequestSizeLimit() throws SQLException- Specified by:
- getRequestSizeLimitin interface- oracle.jdbc.replay.internal.OracleDataSource
- Throws:
- SQLException
 
 - 
getProxyFactorypublic oracle.jdbc.proxy.ProxyFactory getProxyFactory() throws SQLException- Specified by:
- getProxyFactoryin interface- oracle.jdbc.replay.internal.OracleDataSource
- Throws:
- SQLException
 
 - 
registerMBeanpublic static void registerMBean() 
 - 
unregisterMBeanpublic static void unregisterMBean() 
 - 
cleanuppublic static void cleanup() 
 - 
finalizeprotected void finalize() throws Throwable
 - 
debugprotected void debug(Logger logger, Level level, Executable method, String msg) AC specifc
 - 
getMonitorLockpublic final oracle.jdbc.internal.Monitor.CloseableLock getMonitorLock() - Specified by:
- getMonitorLockin interface- oracle.jdbc.internal.Monitor
 
 - 
setTokenSupplierpublic final void setTokenSupplier(java.util.function.Supplier<? extends AccessToken> tokenSupplier) Description copied from interface:OracleCommonDataSourceSets a supplier function that generates an access token when creating a connection with this DataSource. The supplier function is invoked each time thisDataSourcecreates a connection. Instances ofAccessTokenthat are output by the supplier must represent a token type that is supported by Oracle Database for client authentication. The supplier must be thread safe.It is invalid to configure this DataSourcewith both a token supplier and with a user name or password. If invocations ofOracleCommonDataSource.setUser(String),OracleCommonDataSource.setPassword(String),OracleCommonDataSource.setConnectionProperties(java.util.Properties), orOracleCommonDataSource.setConnectionProperty(String, String)have configured thisDataSourcewith a user name or password, and an invocation of this method has also configured a token supplier, then aSQLExceptionindicating an invalid configuration is thrown when creating a connection with this datasource.Note that AccessToken.createJsonWebTokenCache(Supplier)can be called to create a thread safeSupplierthat caches tokens from a user definedSupplier.- Specified by:
- setTokenSupplierin interface- OracleCommonDataSource
- Parameters:
- tokenSupplier- Token supplying function. Not- null.
 
 
- 
 
-