Skip navigation links

Oracle®Database JDBC Java API Reference
12c Release 1 (12.1.0.2)
E56669-01


oracle.jdbc.replay
Interface OracleDataSource

All Superinterfaces:
CommonDataSource, DataSource, Wrapper
All Known Subinterfaces:
OracleConnectionPoolDataSource
All Known Implementing Classes:
OracleConnectionPoolDataSourceImpl, OracleDataSourceImpl

public interface OracleDataSource
extends DataSource

A data source that supports transparent failover replay of JDBC operations.


Field Summary
static String CONNECTION_PROPERTIES
           
static String DATA_SOURCE_NAME
           
static String DATABASE_NAME
           
static String DESCRIPTION
           
static String EXPLICIT_CACHING_ENABLED
           
static String IMPLICIT_CACHING_ENABLED
           
static String MAX_STATEMENTS
           
static String NETWORK_PROTOCOL
           
static String PASSWORD
           
static String PORT_NUMBER
           
static String ROLE_NAME
           
static String SERVER_NAME
           
static String URL
           
static String USER
           

 

Method Summary
 void clearReplayStatistics()
          Clears replay statistics accumulated so far on all connection created by this data source.
 ConnectionInitializationCallback getConnectionInitializationCallback()
          Obtains the registered connection initialization callback, if any.
 Properties getConnectionProperties()
          Gets the connection properties that are set on this data source.
 String getConnectionProperty(String propertyName)
          Gets the specified connection property that are set on this data source.
 String getDatabaseName()
          Gets the database name.
 String getDataSourceName()
          Gets the data source name.
 String getDescription()
          Gets the data source description.
 boolean getExplicitCachingEnabled()
          Returns the current value of the explicitCachingEnabled property.
 boolean getImplicitCachingEnabled()
          getImplicitCachingEnabled Returns the current value of the implicitCachingEnabled property.
 int getMaxStatements()
          Returns the current value of the maxStatements property.
 String getNetworkProtocol()
          Gets the data source network protocol.
 int getPortNumber()
          Gets the database port number.
 ReplayStatistics getReplayStatistics()
          Obtains replay statistics accumulated so far.
 String getRoleName()
          Gets the data source role name.
 String getServerName()
          Gets the database server name.
 String getURL()
          Gets the URL for this data source.
 String getUser()
          Gets the user name for this data source.
 void registerConnectionInitializationCallback(ConnectionInitializationCallback cbk)
          Registers a connection initialization callback.
 void setConnectionProperties(Properties connectionProperties)
          Sets the connection properties on the connection factory.
 void setConnectionProperty(String name, String value)
          Sets a connection property on the connection factory.
 void setDatabaseName(String databaseName)
          Sets the database name.
 void setDataSourceName(String dataSourceName)
          Sets the data source name.
 void setDescription(String description)
          Sets the data source description.
 void setExplicitCachingEnabled(boolean cache)
          Sets the value of the explicitCachingEnabled property, which enables or disables the explicit cache.
 void setImplicitCachingEnabled(boolean cache)
          Sets the value of the implicitCachingEnabled property, which enables or disables the implicit statement cache.
 void setMaxStatements(int max)
          Specifies the value of the maxStatements property.
 void setNetworkProtocol(String networkProtocol)
          Sets the data source network protocol.
 void setPassword(String pd)
          Sets the password with which connections have to be obtained.
 void setPortNumber(int portNumber)
          Sets the database port number.
 void setRoleName(String roleName)
          Sets the data source role name.
 void setServerName(String serverName)
          Sets the database server name.
 void setURL(String url)
          Sets the URL that the data source uses to obtain connections to the database.
 void setUser(String userName)
          Sets the user name with which connections have to be obtained.
 void unregisterConnectionInitializationCallback(ConnectionInitializationCallback cbk)
          Unregisters a specified connection initialization callback.

 

Methods inherited from interface javax.sql.DataSource
getConnection, getConnection

 

Methods inherited from interface javax.sql.CommonDataSource
getLoginTimeout, getLogWriter, setLoginTimeout, setLogWriter

 

Methods inherited from interface java.sql.Wrapper
isWrapperFor, unwrap

 

Field Detail

USER

static final String USER
See Also:
Constant Field Values

URL

static final String URL
See Also:
Constant Field Values

PASSWORD

static final String PASSWORD
See Also:
Constant Field Values

SERVER_NAME

static final String SERVER_NAME
See Also:
Constant Field Values

PORT_NUMBER

static final String PORT_NUMBER
See Also:
Constant Field Values

DATABASE_NAME

static final String DATABASE_NAME
See Also:
Constant Field Values

DATA_SOURCE_NAME

static final String DATA_SOURCE_NAME
See Also:
Constant Field Values

DESCRIPTION

static final String DESCRIPTION
See Also:
Constant Field Values

NETWORK_PROTOCOL

static final String NETWORK_PROTOCOL
See Also:
Constant Field Values

ROLE_NAME

static final String ROLE_NAME
See Also:
Constant Field Values

CONNECTION_PROPERTIES

static final String CONNECTION_PROPERTIES
See Also:
Constant Field Values

MAX_STATEMENTS

static final String MAX_STATEMENTS
See Also:
Constant Field Values

IMPLICIT_CACHING_ENABLED

static final String IMPLICIT_CACHING_ENABLED
See Also:
Constant Field Values

EXPLICIT_CACHING_ENABLED

static final String EXPLICIT_CACHING_ENABLED
See Also:
Constant Field Values

Method Detail

setURL

void setURL(String url)
            throws SQLException
Sets the URL that the data source uses to obtain connections to the database.
Parameters:
url - URL to be set.
Throws:
SQLException

getURL

String getURL()
Gets the URL for this data source.
Returns:
URL for this data source.

setUser

void setUser(String userName)
             throws SQLException
Sets the user name with which connections have to be obtained.
Parameters:
userName - Username to be set.
Throws:
SQLException

getUser

String getUser()
Gets the user name for this data source.
Returns:
userName for this data source.

setPassword

void setPassword(String pd)
                 throws SQLException
Sets the password with which connections have to be obtained.
Parameters:
pd - Passowrd to be set.
Throws:
SQLException

setServerName

void setServerName(String serverName)
                   throws SQLException
Sets the database server name.
Parameters:
serverName - Database server name to be set.
Throws:
SQLException

getServerName

String getServerName()
Gets the database server name.
Returns:
Database server name.

setPortNumber

void setPortNumber(int portNumber)
                   throws SQLException
Sets the database port number.
Parameters:
portNumber - Database port number to be set.
Throws:
SQLException

getPortNumber

int getPortNumber()
Gets the database port number.
Returns:
Database port number.

setDatabaseName

void setDatabaseName(String databaseName)
                     throws SQLException
Sets the database name.
Parameters:
databaseName - Database name to be set.
Throws:
SQLException

getDatabaseName

String getDatabaseName()
Gets the database name.
Returns:
Database name.

setDataSourceName

void setDataSourceName(String dataSourceName)
                       throws SQLException
Sets the data source name.
Parameters:
dataSourceName - datas ource name to be set.
Throws:
SQLException

getDataSourceName

String getDataSourceName()
Gets the data source name.
Returns:
data source name.

setDescription

void setDescription(String description)
                    throws SQLException
Sets the data source description.
Parameters:
description - data source description to be set.
Throws:
SQLException

getDescription

String getDescription()
Gets the data source description.
Returns:
data source description.

setNetworkProtocol

void setNetworkProtocol(String networkProtocol)
                        throws SQLException
Sets the data source network protocol.
Parameters:
networkProtocol - data source network protocol to be set.
Throws:
SQLException

getNetworkProtocol

String getNetworkProtocol()
Gets the data source network protocol.
Returns:
data source network protocol.

setRoleName

void setRoleName(String roleName)
                 throws SQLException
Sets the data source role name.
Parameters:
roleName - data source role name to be set.
Throws:
SQLException

getRoleName

String getRoleName()
Gets the data source role name.
Returns:
data source role name.

registerConnectionInitializationCallback

void registerConnectionInitializationCallback(ConnectionInitializationCallback cbk)
                                              throws SQLException
Registers a connection initialization callback.
Parameters:
cbk - The ConnectionInitializationCallback object to be registered.
Throws:
SQLException - If there is a callback already registered with the pool.

unregisterConnectionInitializationCallback

void unregisterConnectionInitializationCallback(ConnectionInitializationCallback cbk)
                                                throws SQLException
Unregisters a specified connection initialization callback.
Parameters:
cbk - The ConnectionInitializationCallback object to be unregistered.
Throws:
SQLException - If callback removal fails.

getConnectionInitializationCallback

ConnectionInitializationCallback getConnectionInitializationCallback()
Obtains the registered connection initialization callback, if any.
Returns:
The registered ConnectionInitializationCallback, or null if there is no callback registered.

getConnectionProperties

Properties getConnectionProperties()
Gets the connection properties that are set on this data source.
Returns:
Connection properties.

getConnectionProperty

String getConnectionProperty(String propertyName)
Gets the specified connection property that are set on this data source.
Parameters:
propertyName - The name of the specified property.
Returns:
The value of the inquired connection property. Null if the property is not set.

setConnectionProperty

void setConnectionProperty(String name,
                           String value)
                           throws SQLException
Sets a connection property on the connection factory. This is used only for DataSource connection factories that also support connection properties; for example, the oracle.jdbc.pool.OracleDataSource in the Oracle JDBC driver.
Parameters:
name - The name of the connection property to be set on the connection factory class.
value - The value of the connection property to be set on the connection factory class.
Throws:
SQLException - If any exception occurred while setting the connection property.
See Also:
setConnectionFactoryProperties

setConnectionProperties

void setConnectionProperties(Properties connectionProperties)
                             throws SQLException
Sets the connection properties on the connection factory. This is used only for DataSource connection factories that also support connection properties; for example, the oracle.jdbc.pool.OracleDataSource in the Oracle JDBC driver.
Parameters:
connectionProperties - Connection properties to be set on the connection factory class.
Throws:
SQLException - If any exception occurred while setting the connection properties.
See Also:
setConnectionFactoryProperties

setMaxStatements

void setMaxStatements(int max)
                      throws SQLException
Specifies 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.
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

getMaxStatements

int getMaxStatements()
                     throws SQLException
Returns the current value of the maxStatements property.
Throws:
SQLException

setImplicitCachingEnabled

void setImplicitCachingEnabled(boolean cache)
                               throws SQLException
Sets 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().
Parameters:
cache - If true, then implicit caching is enabled. If false, then any existing statement is purged and the implicit caching is disabled.
Throws:
SQLException

getImplicitCachingEnabled

boolean getImplicitCachingEnabled()
                                  throws SQLException
getImplicitCachingEnabled Returns the current value of the implicitCachingEnabled property.
Throws:
SQLException

setExplicitCachingEnabled

void setExplicitCachingEnabled(boolean cache)
                               throws SQLException
Sets 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().
Parameters:
cache - If true, then explicit caching is enabled. If false, then any existing statement is purged and the explicit caching is disabled.
Throws:
SQLException - if called on a logical connection.

getExplicitCachingEnabled

boolean getExplicitCachingEnabled()
                                  throws SQLException
Returns the current value of the explicitCachingEnabled property.
Throws:
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.

Skip navigation links

Oracle®Database JDBC Java API Reference
12c Release 1 (12.1.0.2)
E56669-01


Copyright © 2008, 2014, Oracle and/or its affiliates. All rights reserved.