public interface EmbeddedDerbyDataSourceFactory
DataSource
instances to connect to a Derby resource. The specific resources provide
implementations to this factory. Typically all three kinds of DataSource
s (DataSource
,
ConnectionPoolDataSource
and XADataSource
) are supported by the factory instances.
Factory implementations can support caching of the data sources created; and cached instances of the datasource
are retrieved by setting the cachedInstance
parameter to true
. If an implementation does
not support caching, this parameter is simply ignored and a new instance is returned every time.
Derby resources may optionally check if the derby instance is active, and if so may throw
IllegalStateException
if the DataSource
factory methods are invoked while the underlying
instance is not active.
Modifier and Type | Method and Description |
---|---|
ConnectionPoolDataSource |
getConnectionPoolDataSource(boolean cachedInstance)
Returns a new or cached
ConnectionPoolDataSource instance with parameters set up to create connections to
connect to the underlying Derby instance. |
DataSource |
getDataSource(boolean cachedInstance)
Returns a new or cached
DataSource instance with parameters set up to create connections to connect to
the underlying Derby instance. |
XADataSource |
getXADataSource(boolean cachedInstance)
Returns a new or cached
XADataSource instance with parameters set up to create connections to
connect to the underlying Derby instance. |
DataSource getDataSource(boolean cachedInstance)
DataSource
instance with parameters set up to create connections to connect to
the underlying Derby instance.
For the embedded Derby instance, tha actual instance returned is usually
EmbeddedDataSource
.
cachedInstance
- Should a cached instance be returned if available and caching is enabled.IllegalStateException
- If the underlying implementation does state checking and the resource is not activeConnectionPoolDataSource getConnectionPoolDataSource(boolean cachedInstance)
ConnectionPoolDataSource
instance with parameters set up to create connections to
connect to the underlying Derby instance.
For the embedded Derby instance, tha actual instance returned is usually
EmbeddedConnectionPoolDataSource
.
cachedInstance
- Should a cached instance be returned if available and caching is enabled.IllegalStateException
- If the underlying implementation does state checking and the resource is not activeXADataSource getXADataSource(boolean cachedInstance)
XADataSource
instance with parameters set up to create connections to
connect to the underlying Derby instance.
For the embedded Derby instance, tha actual instance returned is usually
EmbeddedXADataSource
.
cachedInstance
- Should a cached instance be returned if available and caching is enabled.IllegalStateException
- If the underlying implementation does state checking and the resource is not activeCopyright © 2015-2016 Development Entropy (deventropy.org) Contributors