public interface OracleConfigurationProvider
Using the Service Provider Interface (SPI) abstraction, the Oracle JDBC driver can be configured using a configuration service provider. This interface defines such a configuration service and can be implemented by a provider.
A custom JDBC URL can be used to make the driver load a specific configuration
provider. For example, jdbc:oracle:thin:@config-xyz://{parameters}
will make the driver attempt to load a provider of type "xyz".
The provider returns a Properties object that is applied to the
OracleCommonDataSource.setConnectionProperties(Properties)
using the same rules and priorities, except for the url value, that will
be applied with OracleCommonDataSource.setURL(String).
OracleConfigurationJsonSecretProvider.OracleConfigurationJsonSecretProvider.jdbc:oracle:thin:@config-file:config.json
jdbc:oracle:thin:@config-https://myserver/config/myapp?key=dev
{
"connect_descriptor": "(description=(address_list=(address=(protocol=tcp)
(host=myhost)(port=5521)))(connect_data=(service_name=myservice)))",
"user": "scott",
"password": {
"type": "base64",
"value": "dGlnZXI="
},
"wallet_location": {
"type": "base64",
"value": "bXl3YWxsZXRiaW5hcnlmaWxlCg=="
},
"jdbc": {
"autoCommit": "true"
}
}
{
"dev": {
"connect_descriptor": "myhost:5521/myservice",
"user": "scott",
"password": {
"type": "base64",
"value": "dGlnZXI="
},
"jdbc": {
"oracle.jdbc.ReadTimeout": 1000,
"defaultRowPrefetch": 20,
"autoCommit": "false"
},
"time_to_live": 10
}
}
| Modifier and Type | Method and Description |
|---|---|
static OracleConfigurationProvider |
find(java.lang.String providerType)
Helper method to retrieve a provider based on the type.
|
java.util.Properties |
getConnectionProperties(java.lang.String parameters)
Returns the Connection Properties configured in an external
provider.
|
java.lang.String |
getType()
Type of provider (eg: 'azure' for Azure App Configuration).
|
static java.util.Map<java.lang.String,java.lang.String> |
mapOptions(java.lang.String urlOptions)
Helper method to map options out of a url.
|
java.lang.String getType()
java.util.Properties getConnectionProperties(java.lang.String parameters)
throws java.sql.SQLException
parameters - used by the provider to retrieve the connection
properties. Eg: for the 'text' provider is a
location in the file system, for the 'http' is
a URL, for the 'azure' provider is the name of
the App Config followed by prefix of the keys
and an optional label. It is the responsibility
of the provider to specify its format.java.sql.SQLExceptionstatic OracleConfigurationProvider find(java.lang.String providerType)
providerType - static java.util.Map<java.lang.String,java.lang.String> mapOptions(java.lang.String urlOptions)
urlOptions - that contains key-value pairs separated by '&'.