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

public Interface DataSourceLookup

Known Direct Implementers
org.springframework.jdbc.datasource.lookup.JndiDataSourceLookup, org.springframework.jdbc.datasource.lookup.MapDataSourceLookup, org.springframework.jdbc.datasource.lookup.SingleDataSourceLookup, org.springframework.jdbc.datasource.lookup.BeanFactoryDataSourceLookup
Annotations
@FunctionalInterface
Imports
javax.sql.DataSource

Strategy interface for looking up DataSources by name.

Used, for example, to resolve data source names in JPA persistence.xml files.

Authors
Costin Leau, Juergen Hoeller
Since
2.0
See Also
org.springframework.orm.jpa.persistenceunit.DefaultPersistenceUnitManager#setDataSourceLookup

Method Summary

Modifier and TypeMethod and Description
public DataSource

Returns:

the DataSource (never null)
getDataSource
(String
the name of the DataSource
dataSourceName
)

Retrieve the DataSource identified by the given name.

Method Detail

getDataSourceback to summary
public DataSource getDataSource(String dataSourceName) throws DataSourceLookupFailureException

Retrieve the DataSource identified by the given name.

Parameters
dataSourceName:String

the name of the DataSource

Returns:DataSource

the DataSource (never null)

Exceptions
DataSourceLookupFailureException:
if the lookup failed