public interface DataSourceFactory
DataSourceFactory
. The SPI
mechanism will register DataSourceFactory
implementations with the
given name.Modifier and Type | Method | Description |
---|---|---|
DataSource.Builder |
builder() |
Returns a new
DataSource builder. |
static void |
deregisterDataSourceFactory(DataSourceFactory factory) |
Removes the specified factory from the list of registered factories.
|
static DataSourceFactory |
forName(java.lang.String name) |
Uses SPI to find a
DataSourceFactory with the requested name or
null if one is not found. |
java.lang.String |
getName() |
Name by which this factory is registered.
|
static void |
registerDataSourceFactory(DataSourceFactory factory) |
Registers the given factory with.
|
static void |
registerDataSourceFactory(DataSourceFactory factory,
DataSourceFactoryAction da) |
Registers the given factory with the
DataSourceFactoryManager . |
static DataSourceFactory forName(java.lang.String name)
DataSourceFactory
with the requested name or
null
if one is not found.name
- the name that identifies the factoryDataSourceFactory
for name
or null
if one
is not foundstatic void registerDataSourceFactory(DataSourceFactory factory)
registerDataSourceFactory
to make itself known. If the
factory is currently registered, no action is taken.factory
- the new JDBC DataSourceFactory that is to be registered with
the DataSourceFactoryManager
java.lang.NullPointerException
- if factory
is nullstatic void registerDataSourceFactory(DataSourceFactory factory, DataSourceFactoryAction da)
DataSourceFactoryManager
. A
newly-loaded factory class should call the method
registerDataSourceFactory
to make itself known. If the factory is
currently registered, no action is taken.factory
- the new DataSourceFactory that is to be registeredda
- the DataSourceFactoryAction
implementation to be used
when DataSourceFactoryManager#deregisterDataSourceFactory
is calledjava.lang.NullPointerException
- if factory
is nullstatic void deregisterDataSourceFactory(DataSourceFactory factory)
If a null
value is specified for the factory to be removed, then no
action is taken.
If a security manager exists and its checkPermission
denies
permission, then a SecurityException
will be thrown.
If the specified factory is not found in the list of registered factories, then no action is taken. If the factory was found, it will be removed from the list of registered factories.
If a DataSourceFactoryAction
instance was specified when the JDBC
factory was registered, its deregister method will be called prior to the
factory being removed from the list of registered factories.
factory
- the DataSourceFactory to removejava.lang.SecurityException
- if a security manager exists and its
checkPermission
method denies permission to deregister a factory.SecurityManager.checkPermission(java.security.Permission)
DataSource.Builder builder()
DataSource
builder.DataSource
builder. Not null
.java.lang.String getName()
Report a bug or suggest an enhancement
For further API reference and developer documentation see the Java SE Documentation, which contains more detailed, developer-targeted descriptions with conceptual overviews, definitions of terms, workarounds, and working code examples.
Java is a trademark or registered trademark of Oracle and/or its affiliates in the US and other countries.
Copyright © 1993, 2017, Oracle and/or its affiliates, 500 Oracle Parkway, Redwood Shores, CA 94065 USA.
All rights reserved. Use is subject to license terms and the documentation redistribution policy.
DRAFT JDBC 4.4 EA