Interface ConnectionStringProvider
-
- All Superinterfaces:
OracleResourceProvider
public interface ConnectionStringProvider extends OracleResourceProvider
A provider of connection strings for establishing a network connection to Oracle Database.
The oracle.jdbc.provider.connectionString connection property identifies the name of a
ConnectionStringProvider
implementation. Connection properties under the namespace oforacle.jdbc.provider.connectionString
configure any parameters that an implementation defines. To illustrate, the connection properties below would identify a provider named "example-provider", and configure a parameter named "servicePriority":oracle.jdbc.provider.connectionString=example-provider oracle.jdbc.provider.connectionString.servicePriority=medium
ServiceLoader
locates implementations ofConnectionStringProvider
declared by aMETA-INF/services/oracle.jdbc.spi.ConnectionStringProvider
file in the class path, or by amodule-info.java
file with a "provides oracle.jdbc.spi.ConnectionStringProvider
" directive in the module path. Typically, these files are distributed within a jar file that contains aConnectionStringProvider
implementation.- Since:
- 23
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface oracle.jdbc.spi.OracleResourceProvider
OracleResourceProvider.Parameter
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.String
getConnectionString(java.util.Map<OracleResourceProvider.Parameter,java.lang.CharSequence> parameterValues)
Returns a connection string for establishing a network connection to Oracle Database.-
Methods inherited from interface oracle.jdbc.spi.OracleResourceProvider
getName, getParameters
-
-
-
-
Method Detail
-
getConnectionString
java.lang.String getConnectionString(java.util.Map<OracleResourceProvider.Parameter,java.lang.CharSequence> parameterValues)
Returns a connection string for establishing a network connection to Oracle Database. The string returned by this method may have any format specified in Section 8.2.3 of the Oracle JDBC Developer's guide. The string returned by this method should not include the "
jdbc:oracle:{thin|oci|kprb}:@
" prefix.The
parameterValues
passed to this method is aMap
comprised as follows:-
The key set is the same as, or a subset of, the
Parameter
objects returned by an invocation ofOracleResourceProvider.getParameters()
on this provider. -
If no value is configured for a parameter, then the
Map
contains the default value of thatParameter
, if any. If the parameter has no default value, then the map does not contain an entry for thatParameter
. -
The
Map
does not contain entries having null values.
parameterValues
Map
may contain aCharSequence
having a security sensitive value. After this method returns, the caller may wipe the contents of theseCharSequence
values from memory. Implementations of this method should not retain a reference to theseCharSequence
objects.- Parameters:
parameterValues
- Parameters configured by connection properties . Not null. May be empty.- Returns:
- A connection string. Not null.
- Throws:
java.lang.IllegalArgumentException
- If the value of a parameter can not be parsed or interpreted.java.lang.IllegalStateException
- If an implementation-specific failure prevents a resource from being provided.
-
The key set is the same as, or a subset of, the
-
-