Package io.helidon.integrations.jta.jdbc
Class XADataSourceWrappingDataSource
- java.lang.Object
-
- io.helidon.integrations.jdbc.AbstractCommonDataSource
-
- io.helidon.integrations.jdbc.AbstractDataSource
-
- io.helidon.integrations.jta.jdbc.XADataSourceWrappingDataSource
-
- All Implemented Interfaces:
Wrapper
,CommonDataSource
,DataSource
public final class XADataSourceWrappingDataSource extends AbstractDataSource
AnAbstractDataSource
that adapts anXADataSource
to theDataSource
contract.The
XADataSource
being adapted must guarantee that whenclose()
is called on anyConnection
that anXAConnection
supplied by theXADataSource.getXAConnection()
method supplies, the closing operation is propagated to theXAConnection
, or undefined behavior will result.
-
-
Constructor Summary
Constructors Constructor Description XADataSourceWrappingDataSource(XADataSource xaDataSource, Consumer<? super XAResource> resourceEnlister)
Creates a newXADataSourceWrappingDataSource
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Connection
getConnection()
Connection
getConnection(String username, String password)
-
Methods inherited from class io.helidon.integrations.jdbc.AbstractDataSource
isWrapperFor, unwrap
-
Methods inherited from class io.helidon.integrations.jdbc.AbstractCommonDataSource
getLoginTimeout, getLogWriter, getParentLogger, setLoginTimeout, setLogWriter
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface javax.sql.CommonDataSource
createShardingKeyBuilder, getParentLogger
-
Methods inherited from interface javax.sql.DataSource
createConnectionBuilder, getLoginTimeout, getLogWriter, setLoginTimeout, setLogWriter
-
-
-
-
Constructor Detail
-
XADataSourceWrappingDataSource
public XADataSourceWrappingDataSource(XADataSource xaDataSource, Consumer<? super XAResource> resourceEnlister)
Creates a newXADataSourceWrappingDataSource
.- Parameters:
xaDataSource
- theXADataSource
to wrap; must not benull
resourceEnlister
- aConsumer
ofXAResource
instances that enlists them in an active XA transaction; must not benull
-
-
Method Detail
-
getConnection
public Connection getConnection() throws SQLException
- Throws:
SQLException
-
getConnection
public Connection getConnection(String username, String password) throws SQLException
- Throws:
SQLException
-
-