org.compass.core.lucene.engine.store.jdbc
Class AbstractDataSourceProvider
java.lang.Object
org.compass.core.lucene.engine.store.jdbc.AbstractDataSourceProvider
- All Implemented Interfaces:
- DataSourceProvider
- Direct Known Subclasses:
- C3P0DataSourceProvider, DbcpDataSourceProvider, DriverManagerDataSourceProvider, ExternalDataSourceProvider, JndiDataSourceProvider
public abstract class AbstractDataSourceProvider
- extends Object
- implements DataSourceProvider
- Author:
- kimchy
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
driverClass
protected String driverClass
username
protected String username
password
protected String password
autoCommit
protected boolean autoCommit
externalAutoCommit
protected boolean externalAutoCommit
AbstractDataSourceProvider
public AbstractDataSourceProvider()
configure
public void configure(String url,
CompassSettings settings)
throws CompassException
- Description copied from interface:
DataSourceProvider
- Configures the data source provider with the give settings and url,
the configuration will control the
DataSource that will be
instansiated.
- Specified by:
configure in interface DataSourceProvider
- Parameters:
url - The jdbc url connection stringsettings - The settings for the given data source provider (and the DataSource).
- Throws:
CompassException
getDataSource
public DataSource getDataSource()
- Description copied from interface:
DataSourceProvider
- Retuns an instance of the data source, as per the configuration set for it.
Note, that the instance should be created (either in the configure method,
or lazily in this method), and shared for all repeating calls. This will
also allow
DataSourceProvider.closeDataSource() to close the actual data source.
- Specified by:
getDataSource in interface DataSourceProvider
closeDataSource
public void closeDataSource()
- Description copied from interface:
DataSourceProvider
- Closes the created data source.
- Specified by:
closeDataSource in interface DataSourceProvider
doCreateDataSource
protected abstract DataSource doCreateDataSource(String url,
CompassSettings settings)
throws CompassException
- Throws:
CompassException
Copyright (c) 2004-2008 The Compass Project.