public class OracleXADataSource extends OracleXADataSource
For optimization purposes, we implemented 2 versions of OracleXADataSource: one for client, and one for server when used in Java Stored Procedures and in EJB. The server-version is only available in 8.1.6 and post-8.1.6 backends. This one is the implementation of OracleXADataSource for client-side usage and works for both pre- and post-8.1.6 RMs.
The following example illustrates the use of this data source to
create a JDBC XAConnection
:
oracle.jdbc.xa.client.OracleXADataSource oxads =
new oracle.jdbc.xa.client.OracleXADataSource();
oxads.setURL("jdbc:oracle:thin:@//dbhost:dbport/dbservice");
oxads.setUser("User");
oxads.setPassword("Passwd");
oxads.setConnectionProperty("connProp1", "value1");
oxads.setConnectionProperty("connProp2", "value2");
javax.sql.XAConnection xaconn = oxads.getXAConnection();
useNativeXA
CHECKSUM_PROPERTY, clientChecksum11203x, clientChecksum12x, connectionProperties, databaseName, dataSourceName, DEFAULT_SERVICE_NAME, description, DMS_DEFAULT_DATASOURCE_NAME, DMS_ROOT_NAME, doneDumpOnMemoryPressure, driver, driverType, ENABLE_AC_SUPPORT_PROPERTY, ENABLE_SSS_CURSOR_SUPPORT_PROPERTY, explicitCachingEnabled, explicitCachingEnabledSet, FAILOVER_RESTORE_AUTO, FAILOVER_RESTORE_LEVEL1, FAILOVER_RESTORE_LEVEL2, FAILOVER_RESTORE_NONE, FAILOVER_RESTORE_PROPERTY, FAILOVER_TYPE_AUTO, FAILOVER_TYPE_ON_REMOTE, FAILOVER_TYPE_PROPERTY, FAILOVER_TYPE_TRANSACTION, IGNORE_AC_CONTEXT_PROPERTY, implicitCachingEnabled, implicitCachingEnabledSet, INITIATION_TIMEOUT_PROPERTY, isAutoACEnabled, isFirstConnection, isHybrid, isOracleDataSource, isReplayInDynamicMode, isSSSCursorEnabled, isStateRestorationAuto, isTransactionReplayEnabled, loginTimeout, logWriter, maxStatements, maxStatementsSet, networkProtocol, password, portNumber, RECONNECT_DELAY_PROPERTY, RECONNECT_RETRIES_PROPERTY, reconnectDelay, reconnectRetries, replayInitiationTimeout, REQUEST_SIZE_LIMIT_PROPERTY, serverName, serviceName, SESSION_STATE_CONSISTENCY_HYBRID, SESSION_STATE_CONSISTENCY_STATIC, SESSION_STATE_PROPERTY, stateRestorationType, tnsEntry, TRACE, trackerInitialized, unnamedInstanceCount, url, user
CONNECTION_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 and Description |
---|
OracleXADataSource()
Create an OracleXADataSource instance.
|
Modifier and Type | Method and Description |
---|---|
OracleXAConnectionBuilderImpl |
createXAConnectionBuilder()
Creates a new Oracle XA ConnectionBuilder instance
|
javax.sql.XAConnection |
getXAConnection()
Attempt to establish a database connection.
|
javax.sql.XAConnection |
getXAConnection(OracleXAConnectionBuilderImpl builder) |
javax.sql.XAConnection |
getXAConnection(java.lang.String userName,
java.lang.String passwd)
Attempt to establish a database connection.
|
getConnectionDuringExceptionHandling, setURL
createPooledConnectionBuilder, getConnection, getConnection, getConnection, getPhysicalConnection, getPhysicalConnection, getPhysicalConnection, getPhysicalConnection, getPhysicalConnection, getPooledConnection, getPooledConnection
addRefProperties, cleanup, clearDoneDumpOnMemoryPressure, clearReplayStatistics, createConnectionBuilder, dms_data_source_type, enableACAndProxifyIfNecessary, finalize, getConnection, getConnection, getConnectionInitializationCallback, getConnectionNoProxy, getConnectionProperties, getConnectionProperty, getDatabaseName, getDataSourceName, getDescription, getDiagnosable, getDriverType, getExplicitCachingEnabled, getImplicitCachingEnabled, getLoginTimeout, getLogWriter, getMaxStatements, getMonitorLock, getNetworkProtocol, getParentLogger, getPassword, getPhysicalConnection, getPortNumber, getProxyFactory, getReference, getReplayStatistics, getReplayStatisticsString, getRequestSizeLimit, getRoleName, getServerName, getServiceName, getSSSCursorProperty, getSystemProperty, getTNSEntryName, getURL, getUser, isWrapperFor, makeURL, registerConnectionInitializationCallback, registerMBean, removeReplayStatistics, setConnectionProperties, setConnectionProperty, setDatabaseName, setDataSourceName, setDescription, setDriverType, setExplicitCachingEnabled, setHostnameResolver, setImplicitCachingEnabled, setLoginTimeout, setLogWriter, setMaxStatements, setNetworkProtocol, setPassword, setPortNumber, setRoleName, setServerName, setServiceName, setSingleShardTransactionSupport, setSSLContext, setTNSEntryName, setTokenSupplier, setupACSpecificProperties, setUser, unregisterConnectionInitializationCallback, unregisterMBean, unwrap, updateReplayStatistics
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getPooledConnection
createPooledConnectionBuilder
clearDoneDumpOnMemoryPressure, getConnectionNoProxy, getProxyFactory, getReplayStatisticsString, getRequestSizeLimit, removeReplayStatistics, updateReplayStatistics
clearReplayStatistics, getConnectionInitializationCallback, getExplicitCachingEnabled, getImplicitCachingEnabled, getMaxStatements, getReplayStatistics, getRoleName, registerConnectionInitializationCallback, setExplicitCachingEnabled, setImplicitCachingEnabled, setMaxStatements, setRoleName, unregisterConnectionInitializationCallback
createConnectionBuilder, setExecutorService
getLoginTimeout, getLogWriter, getParentLogger, setLoginTimeout, setLogWriter
begin, beginCurrentSql, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debugp, end, endCurrentSql, format, isDebugEnabled, isDiagnoseFirstFailureEnabled, isLoggable, isSensitiveEnabled, onClose, propertyChange, resumeLogging, secure, suspendLogging, trace, tracep
public OracleXADataSource() throws java.sql.SQLException
java.sql.SQLException
- if error occurs while creating an objectpublic javax.sql.XAConnection getXAConnection() throws java.sql.SQLException
getXAConnection
in interface javax.sql.XADataSource
getXAConnection
in class OracleXADataSource
java.sql.SQLException
- if a database-access error occurs.public javax.sql.XAConnection getXAConnection(java.lang.String userName, java.lang.String passwd) throws java.sql.SQLException
getXAConnection
in interface javax.sql.XADataSource
getXAConnection
in class OracleXADataSource
userName
- the database user on whose behalf the Connection is madepasswd
- the user's passwordjava.sql.SQLException
- if a database-access error occurs.public javax.sql.XAConnection getXAConnection(OracleXAConnectionBuilderImpl builder) throws java.sql.SQLException
java.sql.SQLException
public OracleXAConnectionBuilderImpl createXAConnectionBuilder()
createXAConnectionBuilder
in interface OracleXADataSource
createXAConnectionBuilder
in class OracleXADataSource