public class DataSourceXAConnectionFactory extends Object implements XAConnectionFactory
Constructor and Description |
---|
DataSourceXAConnectionFactory(TransactionManager transactionManager,
XADataSource xaDataSource)
Creates an DataSourceXAConnectionFactory which uses the specified XADataSource to create database connections.
|
DataSourceXAConnectionFactory(TransactionManager transactionManager,
XADataSource xaDataSource,
String userName,
char[] userPassword)
Creates an DataSourceXAConnectionFactory which uses the specified XADataSource to create database connections.
|
DataSourceXAConnectionFactory(TransactionManager transactionManager,
XADataSource xaDataSource,
String userName,
char[] userPassword,
TransactionSynchronizationRegistry transactionSynchronizationRegistry)
Creates an DataSourceXAConnectionFactory which uses the specified XADataSource to create database connections.
|
DataSourceXAConnectionFactory(TransactionManager transactionManager,
XADataSource xaDataSource,
String userName,
String userPassword)
Creates an DataSourceXAConnectionFactory which uses the specified XADataSource to create database connections.
|
DataSourceXAConnectionFactory(TransactionManager transactionManager,
XADataSource xaDataSource,
TransactionSynchronizationRegistry transactionSynchronizationRegistry)
Creates an DataSourceXAConnectionFactory which uses the specified XADataSource to create database connections.
|
Modifier and Type | Method and Description |
---|---|
Connection |
createConnection()
Create a new
Connection in an implementation specific fashion. |
TransactionRegistry |
getTransactionRegistry()
Gets the TransactionRegistry for this connection factory which contains a the XAResource for every connection
created by this factory.
|
String |
getUsername()
Deprecated.
Use
getUserName() . |
String |
getUserName()
Gets the user name used to authenticate new connections.
|
char[] |
getUserPassword() |
XADataSource |
getXaDataSource() |
void |
setPassword(char[] userPassword)
Sets the password used to authenticate new connections.
|
void |
setPassword(String userPassword)
Sets the password used to authenticate new connections.
|
void |
setUsername(String userName)
Sets the user name used to authenticate new connections.
|
public DataSourceXAConnectionFactory(TransactionManager transactionManager, XADataSource xaDataSource)
transactionManager
- the transaction manager in which connections will be enlistedxaDataSource
- the data source from which connections will be retrievedpublic DataSourceXAConnectionFactory(TransactionManager transactionManager, XADataSource xaDataSource, String userName, char[] userPassword)
transactionManager
- the transaction manager in which connections will be enlistedxaDataSource
- the data source from which connections will be retrieveduserName
- the user name used for authenticating new connections or null for unauthenticateduserPassword
- the password used for authenticating new connectionspublic DataSourceXAConnectionFactory(TransactionManager transactionManager, XADataSource xaDataSource, String userName, char[] userPassword, TransactionSynchronizationRegistry transactionSynchronizationRegistry)
transactionManager
- the transaction manager in which connections will be enlistedxaDataSource
- the data source from which connections will be retrieveduserName
- the user name used for authenticating new connections or null for unauthenticateduserPassword
- the password used for authenticating new connectionstransactionSynchronizationRegistry
- register with this TransactionSynchronizationRegistrypublic DataSourceXAConnectionFactory(TransactionManager transactionManager, XADataSource xaDataSource, String userName, String userPassword)
transactionManager
- the transaction manager in which connections will be enlistedxaDataSource
- the data source from which connections will be retrieveduserName
- the user name used for authenticating new connections or null for unauthenticateduserPassword
- the password used for authenticating new connectionspublic DataSourceXAConnectionFactory(TransactionManager transactionManager, XADataSource xaDataSource, TransactionSynchronizationRegistry transactionSynchronizationRegistry)
transactionManager
- the transaction manager in which connections will be enlistedxaDataSource
- the data source from which connections will be retrievedtransactionSynchronizationRegistry
- register with this TransactionSynchronizationRegistrypublic Connection createConnection() throws SQLException
XAConnectionFactory
Connection
in an implementation specific fashion.
An implementation can assume that the caller of this will wrap the connection in a proxy that protects access to the setAutoCommit, commit and rollback when enrolled in a XA transaction.
createConnection
in interface ConnectionFactory
createConnection
in interface XAConnectionFactory
Connection
SQLException
- if a database error occurs creating the connectionpublic TransactionRegistry getTransactionRegistry()
XAConnectionFactory
getTransactionRegistry
in interface XAConnectionFactory
@Deprecated public String getUsername()
getUserName()
.public String getUserName()
public char[] getUserPassword()
public XADataSource getXaDataSource()
public void setPassword(char[] userPassword)
userPassword
- the password used for authenticating the connection or null for unauthenticated.public void setPassword(String userPassword)
userPassword
- the password used for authenticating the connection or null for unauthenticatedpublic void setUsername(String userName)
userName
- the user name used for authenticating the connection or null for unauthenticatedCopyright © 2001–2019 The Apache Software Foundation. All rights reserved.