Class SingleDataSourceLookup
java.lang.Object
org.springframework.jdbc.datasource.lookup.SingleDataSourceLookup
- All Implemented Interfaces:
DataSourceLookup
An implementation of the DataSourceLookup that simply wraps a
single given DataSource, returned for any data source name.
- Since:
- 2.0
- Author:
- Juergen Hoeller
-
Constructor Summary
ConstructorDescriptionSingleDataSourceLookup
(DataSource dataSource) Create a new instance of theSingleDataSourceLookup
class. -
Method Summary
Modifier and TypeMethodDescriptiongetDataSource
(String dataSourceName) Retrieve the DataSource identified by the given name.
-
Constructor Details
-
SingleDataSourceLookup
Create a new instance of theSingleDataSourceLookup
class.- Parameters:
dataSource
- the singleDataSource
to wrap
-
-
Method Details
-
getDataSource
Description copied from interface:DataSourceLookup
Retrieve the DataSource identified by the given name.- Specified by:
getDataSource
in interfaceDataSourceLookup
- Parameters:
dataSourceName
- the name of the DataSource- Returns:
- the DataSource (never
null
)
-