public final class AWSSecretsManagerOracleDriver extends AWSSecretsManagerDriver
Provides support for accessing Oracle databases using credentials stored within AWS Secrets Manager.
Configuration properties are specified using the "oracle" subprefix (e.g drivers.oracle.realDriverClass).
For error codes see:
| Modifier and Type | Field and Description |
|---|---|
static int |
INCORRECT_USER_PASSWORD
ORA-09911.
|
static int |
INVALID_USERNAME_OR_PASSWORD
ORA-01017.
|
static String |
SUBPREFIX
Set to oracle.
|
static int |
USER_CREDENTIALS_DO_NOT_MATCH
ORA-17079.
|
INVALID_SECRET_STRING_JSON, MAX_RETRY, PROPERTY_PREFIX, SCHEME| Constructor and Description |
|---|
AWSSecretsManagerOracleDriver()
Constructs the driver setting the properties from the properties file using system properties as defaults.
|
AWSSecretsManagerOracleDriver(com.amazonaws.services.secretsmanager.AWSSecretsManager client)
Constructs the driver setting the properties from the properties file using system properties as defaults.
|
AWSSecretsManagerOracleDriver(com.amazonaws.services.secretsmanager.AWSSecretsManagerClientBuilder builder)
Constructs the driver setting the properties from the properties file using system properties as defaults.
|
AWSSecretsManagerOracleDriver(com.amazonaws.secretsmanager.caching.SecretCache cache)
Constructs the driver setting the properties from the properties file using system properties as defaults.
|
AWSSecretsManagerOracleDriver(com.amazonaws.secretsmanager.caching.SecretCacheConfiguration cacheConfig)
Constructs the driver setting the properties from the properties file using system properties as defaults.
|
| Modifier and Type | Method and Description |
|---|---|
String |
constructUrlFromEndpointPortDatabase(String endpoint,
String port,
String dbname)
Construct a database URL from the endpoint, port and database name.
|
String |
getDefaultDriverClass()
Get the default real driver class name for this driver.
|
String |
getPropertySubprefix()
Gets the "subprefix" used for configuration properties for this driver.
|
boolean |
isExceptionDueToAuthenticationError(Exception e)
Determines whether or not an
Exception is due to an authentication failure with the remote
database. |
acceptsURL, connect, getMajorVersion, getMinorVersion, getParentLogger, getPropertyInfo, getWrappedDriver, jdbcCompliant, registerpublic static final int USER_CREDENTIALS_DO_NOT_MATCH
public static final int INVALID_USERNAME_OR_PASSWORD
public static final int INCORRECT_USER_PASSWORD
public static final String SUBPREFIX
public AWSSecretsManagerOracleDriver()
public AWSSecretsManagerOracleDriver(com.amazonaws.secretsmanager.caching.SecretCache cache)
cache - Secret cache to use to retrieve secretspublic AWSSecretsManagerOracleDriver(com.amazonaws.services.secretsmanager.AWSSecretsManagerClientBuilder builder)
builder - Builder used to instantiate cachepublic AWSSecretsManagerOracleDriver(com.amazonaws.services.secretsmanager.AWSSecretsManager client)
client - AWS Secrets Manager client to instantiate cachepublic AWSSecretsManagerOracleDriver(com.amazonaws.secretsmanager.caching.SecretCacheConfiguration cacheConfig)
cacheConfig - Cache configuration to instantiate cachepublic String getPropertySubprefix()
AWSSecretsManagerDrivergetPropertySubprefix in class AWSSecretsManagerDriverpublic boolean isExceptionDueToAuthenticationError(Exception e)
AWSSecretsManagerDriverException is due to an authentication failure with the remote
database. This method is called during connect to decide if authentication needs to be attempted
again with refreshed credentials. A good way to implement this is to look up the error codes that
java.sqlSQLExceptions will have when an authentication failure occurs. These are database
specific.isExceptionDueToAuthenticationError in class AWSSecretsManagerDrivere - The Exception to test.Exception indicates that
the credentials used for authentication are stale.public String constructUrlFromEndpointPortDatabase(String endpoint, String port, String dbname)
AWSSecretsManagerDriverconnect method is called with a secret ID instead of a URL.constructUrlFromEndpointPortDatabase in class AWSSecretsManagerDriverendpoint - The endpoint retrieved from the secret cacheport - The port retrieved from the secret cachedbname - The database name retrieved from the secret cachepublic String getDefaultDriverClass()
AWSSecretsManagerDrivergetDefaultDriverClass in class AWSSecretsManagerDriverCopyright © 2022. All rights reserved.