public final class DataSourceFinder extends Object
DataSourceFactorySpi
implementations.
In addition to implementing this interface data souces should have a services file:
META-INF/services/org.geotools.data.jdbc.DataSourceFactorySpi
The file should contain a single line which gives the full name of the implementing class.
Example:
org.geotools.data.jdbc.DBCPDataSourceFactory
Modifier and Type | Field and Description |
---|---|
protected static Logger |
LOGGER
The logger for the filter module.
|
Modifier and Type | Method and Description |
---|---|
static Iterator<DataSourceFactorySpi> |
getAvailableDataSources()
Finds all implementations of DataStoreFactory which have registered using the services
mechanism, and that have the appropriate libraries on the classpath.
|
static DataSource |
getDataSource(Map params)
Checks each available datasource implementation in turn and returns the first one which
claims to support the resource identified by the params object.
|
static UnWrapper |
getUnWrapper(Connection conn)
Checks each available datasource implementation in turn and returns the first one which
claims to support the resource identified by the params object.
|
static UnWrapper |
getUnWrapper(Statement st)
Checks each available
UnWrapper implementation in turn and returns the first one
which claims to support the resource identified by the params object. |
static Iterator<UnWrapper> |
getUnWrappers()
Finds all implementations of UnWrapper which have registered using the services mechanism,
and that have the appropriate libraries on the classpath.
|
static void |
scanForPlugins()
Scans for factory plug-ins on the application class path.
|
protected static final Logger LOGGER
public static DataSource getDataSource(Map params) throws IOException
params
- A Map object which contains a defenition of the resource to connect to. for
file based resources the property 'url' should be set within this Map.IOException
- If a suitable loader can be found, but it can not be attached to the
specified resource without errors.public static UnWrapper getUnWrapper(Connection conn) throws IOException
params
- A Map object which contains a defenition of the resource to connect to. for
file based resources the property 'url' should be set within this Map.IOException
- If a suitable loader can be found, but it can not be attached to the
specified resource without errors.public static UnWrapper getUnWrapper(Statement st) throws IOException
UnWrapper
implementation in turn and returns the first one
which claims to support the resource identified by the params object.params
- A Map object which contains a defenition of the resource to connect to. for
file based resources the property 'url' should be set within this Map.IOException
- If a suitable loader can be found, but it can not be attached to the
specified resource without errors.public static Iterator<DataSourceFactorySpi> getAvailableDataSources()
public static Iterator<UnWrapper> getUnWrappers()
public static void scanForPlugins()
Copyright © 1996–2019 Geotools. All rights reserved.