Interface DataSourceFactory
- All Known Implementing Classes:
- JndiDataSourceFactory,- SharedPoolDataSourceFactory
public interface DataSourceFactory
A factory that returns a DataSource.
 Borrowed from Apache DB Torque
- 
Field SummaryFields
- 
Method SummaryModifier and TypeMethodDescriptionvoidclose()A hook which is called when the resources of the associated DataSource can be released.getName()voidinitialize(JDBCDiskCacheAttributes config) Initialize the factory.
- 
Field Details- 
DSFACTORY_KEYKey for the configuration which contains DataSourceFactories- See Also:
 
- 
FACTORY_KEYKey for the configuration which contains the fully qualified name of the factory implementation class- See Also:
 
 
- 
- 
Method Details- 
getName- Returns:
- the name of the factory.
 
- 
getDataSource- Returns:
- the DataSourceconfigured by the factory.
- Throws:
- SQLException- if the source can't be returned
 
- 
initializeInitialize the factory.- Parameters:
- config- the factory settings
- Throws:
- SQLException- Any exceptions caught during processing will be rethrown wrapped into a SQLException.
 
- 
closeA hook which is called when the resources of the associated DataSource can be released. After close() is called, the other methods may not work any more (e.g. getDataSource() might return null). It is not guaranteed that this method does anything. For example, we do not want to close connections retrieved via JNDI, so the JndiDataSouurceFactory does not close these connections- Throws:
- SQLException- Any exceptions caught during processing will be rethrown wrapped into a SQLException.
 
 
-