|
spring-jdbc | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.jdbc.datasource.lookup.BeanFactoryDataSourceLookup
public class BeanFactoryDataSourceLookup
DataSourceLookup
implementation based on a Spring BeanFactory
.
Will lookup Spring managed beans identified by bean name,
expecting them to be of type javax.sql.DataSource
.
BeanFactory
Constructor Summary | |
---|---|
BeanFactoryDataSourceLookup()
Create a new instance of the BeanFactoryDataSourceLookup class. |
|
BeanFactoryDataSourceLookup(org.springframework.beans.factory.BeanFactory beanFactory)
Create a new instance of the BeanFactoryDataSourceLookup class. |
Method Summary | |
---|---|
javax.sql.DataSource |
getDataSource(java.lang.String dataSourceName)
Retrieve the DataSource identified by the given name. |
void |
setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BeanFactoryDataSourceLookup()
BeanFactoryDataSourceLookup
class.
The BeanFactory to access must be set via setBeanFactory
.
setBeanFactory(org.springframework.beans.factory.BeanFactory)
public BeanFactoryDataSourceLookup(org.springframework.beans.factory.BeanFactory beanFactory)
BeanFactoryDataSourceLookup
class.
Use of this constructor is redundant if this object is being created
by a Spring IoC container, as the supplied BeanFactory
will be
replaced by the BeanFactory
that creates it (c.f. the
BeanFactoryAware
contract). So only use this constructor if you
are using this class outside the context of a Spring IoC container.
beanFactory
- the bean factory to be used to lookup DataSources
Method Detail |
---|
public void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
setBeanFactory
in interface org.springframework.beans.factory.BeanFactoryAware
public javax.sql.DataSource getDataSource(java.lang.String dataSourceName) throws DataSourceLookupFailureException
DataSourceLookup
getDataSource
in interface DataSourceLookup
dataSourceName
- the name of the DataSource
null
)
DataSourceLookupFailureException
- if the lookup failed
|
spring-jdbc | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |