Package org.axonframework.common.jdbc
Class DataSourceConnectionProvider
java.lang.Object
org.axonframework.common.jdbc.DataSourceConnectionProvider
- All Implemented Interfaces:
ConnectionProvider
ConnectionProvider implementation that obtains a connection from a given DataSource.
- Since:
- 2.2
- Author:
- Allard Buijze
-
Constructor Summary
ConstructorsConstructorDescriptionDataSourceConnectionProvider(DataSource dataSource) Initialize the Connection Provider, using givendataSourceto obtain new connections. -
Method Summary
Modifier and TypeMethodDescriptionReturns a connection, ready for use.
-
Constructor Details
-
DataSourceConnectionProvider
Initialize the Connection Provider, using givendataSourceto obtain new connections.- Parameters:
dataSource- The DataSource to obtain connections from
-
-
Method Details
-
getConnection
Description copied from interface:ConnectionProviderReturns a connection, ready for use.The caller must never commit, roll back, or close the returned connection directly; its lifecycle is managed externally by whatever this provider obtained it from.
- Specified by:
getConnectionin interfaceConnectionProvider- Returns:
- a connection to use, never
null - Throws:
SQLException- when an error occurs obtaining the connection
-