Class JndiDataSourceLookup
- java.lang.Object
- org.springframework.jndi.JndiAccessor
- org.springframework.jndi.JndiLocatorSupport
- org.springframework.jdbc.datasource.lookup.JndiDataSourceLookup
- All Implemented Interfaces:
DataSourceLookup
public class JndiDataSourceLookup extends JndiLocatorSupport implements DataSourceLookup
JNDI-basedDataSourceLookupimplementation.For specific JNDI configuration, it is recommended to configure the "jndiEnvironment"/"jndiTemplate" properties.
- Since:
- 2.0
- Author:
- Costin Leau, Juergen Hoeller
- See Also:
JndiAccessor.setJndiEnvironment(java.util.Properties),JndiAccessor.setJndiTemplate(org.springframework.jndi.JndiTemplate)
Field Summary
Fields inherited from class org.springframework.jndi.JndiLocatorSupport
CONTAINER_PREFIX
Fields inherited from class org.springframework.jndi.JndiAccessor
logger
Constructor Summary
Constructors Constructor Description JndiDataSourceLookup()
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DataSourcegetDataSource(String dataSourceName)Retrieve the DataSource identified by the given name.Methods inherited from class org.springframework.jndi.JndiLocatorSupport
convertJndiName, isResourceRef, lookup, lookup, setResourceRef
Methods inherited from class org.springframework.jndi.JndiAccessor
getJndiEnvironment, getJndiTemplate, setJndiEnvironment, setJndiTemplate
Constructor Detail
JndiDataSourceLookup
public JndiDataSourceLookup()
Method Detail
getDataSource
public DataSource getDataSource(String dataSourceName) throws DataSourceLookupFailureException
Description copied from interface:DataSourceLookupRetrieve the DataSource identified by the given name.- Specified by:
getDataSourcein interfaceDataSourceLookup- Parameters:
dataSourceName- the name of the DataSource- Returns:
- the DataSource (never
null) - Throws:
DataSourceLookupFailureException- if the lookup failed