Top Description Fields Constructors Methods
org.springframework.jdbc.datasource.lookup

public Class SingleDataSourceLookup

extends Object
implements DataSourceLookup
Class Inheritance
All Implemented Interfaces
org.springframework.jdbc.datasource.lookup.DataSourceLookup
Imports
javax.sql.DataSource, org.springframework.util.Assert

An implementation of the DataSourceLookup that simply wraps a single given DataSource, returned for any data source name.
Author
Juergen Hoeller
Since
2.0

Field Summary

Modifier and TypeField and Description
private final DataSource

Constructor Summary

AccessConstructor and Description
public
SingleDataSourceLookup(DataSource
the single DataSource to wrap
dataSource
)

Create a new instance of the SingleDataSourceLookup class.

Method Summary

Modifier and TypeMethod and Description
public DataSource
getDataSource(String
the name of the DataSource
dataSourceName
)

Implements org.springframework.jdbc.datasource.lookup.DataSourceLookup.getDataSource.

Retrieve the DataSource identified by the given name.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

dataSourceback to summary
private final DataSource dataSource

Constructor Detail

SingleDataSourceLookupback to summary
public SingleDataSourceLookup(DataSource dataSource)

Create a new instance of the SingleDataSourceLookup class.

Parameters
dataSource:DataSource

the single DataSource to wrap

Method Detail

getDataSourceback to summary
public DataSource getDataSource(String dataSourceName)

Implements org.springframework.jdbc.datasource.lookup.DataSourceLookup.getDataSource.

Doc from org.springframework.jdbc.datasource.lookup.DataSourceLookup.getDataSource.

Retrieve the DataSource identified by the given name.

Parameters
dataSourceName:String

the name of the DataSource

Returns:DataSource

the DataSource (never null)

Annotations
@Override