public final class JdbcUrlUtil extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_AWS_PORT
Default Amazon Keyspaces port.
|
static int |
DEFAULT_PORT
Default Cassandra cluster port.
|
static String |
KEY_ACTIVE_PROFILE
JDBC URL parameter key for the active execution profile.
|
static String |
KEY_ASTRA_REGION
JDBC URL parameter key for the region of the AstraDB instance.
|
static String |
KEY_AWS_REGION
JDBC URL parameter key for the AWS region of the contact point.
|
static String |
KEY_AWS_SECRET_NAME
JDBC URL parameter key for the secret name to use to retrieve credentials.
|
static String |
KEY_AWS_SECRET_REGION
JDBC URL parameter key for the AWS region.
|
static String |
KEY_CLOUD_SECURE_CONNECT_BUNDLE
JDBC URL parameter key for the cloud secure connect bundle.
|
static String |
KEY_COMPLIANCE_MODE
JDBC URL parameter key for the compliance mode.
|
static String |
KEY_CONFIG_FILE
JDBC URL parameter key for the configuration file.
|
static String |
KEY_CONNECT_TIMEOUT
JDBC URL parameter key for the connection timeout.
|
static String |
KEY_CONSISTENCY
JDBC URL parameter key for the consistency.
|
static String |
KEY_CUSTOM_CODECS
JDBC URL parameter key for the custom codecs.
|
static String |
KEY_DEBUG
JDBC URL parameter key for the debug mode.
|
static String |
KEY_ENABLE_SSL
JDBC URL parameter key for SSL enabling.
|
static String |
KEY_FETCH_SIZE
JDBC URL parameter key for the fetch size (request page size).
|
static String |
KEY_KEEP_ALIVE
JDBC URL parameter key for the TCP keep-alive enabling.
|
static String |
KEY_LOAD_BALANCING_POLICY
JDBC URL parameter key for the load balancing policy.
|
static String |
KEY_LOCAL_DATACENTER
JDBC URL parameter key for the local data center.
|
static String |
KEY_PASSWORD
JDBC URL parameter key for the user password.
|
static String |
KEY_RECONNECT_POLICY
JDBC URL parameter key for the reconnection policy.
|
static String |
KEY_REQUEST_TIMEOUT
JDBC URL parameter key for the request timeout.
|
static String |
KEY_RETRY_POLICY
JDBC URL parameter key for the retry policy.
|
static String |
KEY_SERIAL_CONSISTENCY
JDBC URL parameter key for the serial consistency.
|
static String |
KEY_SSL_ENGINE_FACTORY
JDBC URL parameter key for the custom SSL engine factory (
SslEngineFactory). |
static String |
KEY_SSL_HOSTNAME_VERIFICATION
JDBC URL parameter key for SSL hostname verification disabling.
|
static String |
KEY_TCP_NO_DELAY
JDBC URL parameter key for the Nagle's algorithm enabling.
|
static String |
KEY_TOKEN
JDBC URL parameter key for the token used to connect to an AstraDB instance.
|
static String |
KEY_USE_KERBEROS
JDBC URL parameter key for Kerberos auth provider enabling.
|
static String |
KEY_USE_SIG_V4
JDBC URL parameter key for Amazon Signature V4 auth provider enabling.
|
static String |
KEY_USER
JDBC URL parameter key for the username.
|
static String |
PROTOCOL
JDBC protocol for Cassandra connection.
|
static String |
PROTOCOL_ASTRA
JDBC protocol for Cassandra DBaaS connection.
|
static String |
PROTOCOL_AWS
JDBC protocol for Amazon Keyspaces connection.
|
static String |
PROTOCOL_DBAAS
Deprecated.
Use
PROTOCOL_ASTRA for connections to AstraDB. The support of "jdbc:cassandra:dbaas:"
protocol will be removed in a future version. |
static String |
TAG_ACTIVE_PROFILE
Property name used to retrieve the execution profile to use when the connection to Cassandra is created.
|
static String |
TAG_ASTRA_CONNECTION
Property name used to determine if the current connection is established to an AstraDB cloud database.
|
static String |
TAG_ASTRA_DATABASE_NAME
Property name used to determine the name of the AstraDB cloud database to which the connection has to be
established.
|
static String |
TAG_ASTRA_REGION
Property name used to determine the region of the AstraDB instance to connect to.
|
static String |
TAG_AWS_CONNECTION
Property name used to determine if the current connection is established to an Amazon Keyspaces database.
|
static String |
TAG_AWS_REGION
Property name used to determine the region of the Amazon Keyspaces contact point.
|
static String |
TAG_AWS_SECRET_NAME
Property name used to retrieve the credentials in AWS Secret Manager from the given secret name.
|
static String |
TAG_AWS_SECRET_REGION
Property name used to retrieve the credentials in AWS Secret Manager in the given AWS region.
|
static String |
TAG_CLOUD_SECURE_CONNECT_BUNDLE
Property name used to retrieve the secure connect Bundle when the connection to Cassandra DBaaS is established.
|
static String |
TAG_COMPLIANCE_MODE
Property name used to retrieve the compliance mode to use when the connection to Cassandra is established.
|
static String |
TAG_CONFIG_FILE
Property name used to retrieve the configuration file when the connection to Cassandra is established.
|
static String |
TAG_CONNECT_TIMEOUT
Property name used to retrieve the connection timeout when the connection to Cassandra is established.
|
static String |
TAG_CONSISTENCY_LEVEL
Property name used to retrieve the consistency when the connection to Cassandra is established.
|
static String |
TAG_CONTACT_POINTS
Property name used to retrieve the contact points when the connection to Cassandra is established.
|
static String |
TAG_CUSTOM_CODECS
Property name used to retrieve the custom codecs to register, in addition to the default ones, when the
connection to Cassandra is established.
|
static String |
TAG_DATABASE_NAME
Property name used to retrieve the keyspace name when the connection to Cassandra is established.
|
static String |
TAG_DBAAS_CONNECTION
Deprecated.
Use
PROTOCOL_ASTRA for connections to AstraDB. The support of "jdbc:cassandra:dbaas:"
protocol will be removed in a future version. |
static String |
TAG_DEBUG
Property name used to retrieve the debug mode value when the connection to Cassandra is established.
|
static String |
TAG_ENABLE_SSL
Property name used to retrieve the SSL enabling value when the connection to Cassandra is established.
|
static String |
TAG_FETCH_SIZE
Property name used to retrieve the fetch size (request page size) when the connection to Cassandra is
established.
|
static String |
TAG_KEEP_ALIVE
Property name used to retrieve the TCP keep-alive enabling when the connection to Cassandra is established.
|
static String |
TAG_LOAD_BALANCING_POLICY
Property name used to retrieve the load balancing policy when the connection to Cassandra is established.
|
static String |
TAG_LOCAL_DATACENTER
Property name used to retrieve the local data center when the connection to Cassandra is established.
|
static String |
TAG_PASSWORD
Property name used to retrieve the user password when the connection to Cassandra is established.
|
static String |
TAG_RECONNECT_POLICY
Property name used to retrieve the reconnection policy when the connection to Cassandra is established.
|
static String |
TAG_REQUEST_TIMEOUT
Property name used to retrieve the request timeout when the connection to Cassandra is established.
|
static String |
TAG_RETRY_POLICY
Property name used to retrieve the retry policy when the connection to Cassandra is established.
|
static String |
TAG_SERIAL_CONSISTENCY_LEVEL
Property name used to retrieve the serial consistency when the connection to Cassandra is established.
|
static String |
TAG_SSL_ENGINE_FACTORY
Property name used to retrieve the custom SSL engine factory when the connection to Cassandra is established.
|
static String |
TAG_SSL_HOSTNAME_VERIFICATION
Property name used to retrieve the SSL hostname verification enabling when the connection to Cassandra is
established.
|
static String |
TAG_TCP_NO_DELAY
Property name used to retrieve the Nagle's algorithm enabling when the connection to Cassandra is established.
|
static String |
TAG_TOKEN
Property name used to retrieve the token used to connect to an AstraDB instance.
|
static String |
TAG_USE_KERBEROS
Property name used to retrieve the Kerberos auth provider enabling when the connection to Cassandra is
established.
|
static String |
TAG_USE_SIG_V4
Property name used to retrieve the Amazon Signature V4 auth provider enabling when the connection to Amazon
Keyspaces is established.
|
static String |
TAG_USER
Property name used to retrieve the username when the connection to Cassandra is established.
|
| Modifier and Type | Method and Description |
|---|---|
static String |
createSubName(Properties props)
Creates a "sub-name" portion of a JDBC URL from properties.
|
static List<com.datastax.oss.driver.api.core.type.codec.TypeCodec<?>> |
parseCustomCodecs(String customCodecs)
Parses the given comma-separated list of custom codecs class names into a list of instantiated codecs.
|
static Map<com.datastax.oss.driver.api.core.config.DriverOption,Object> |
parseReconnectionPolicy(String reconnectionPolicyString)
Parses the reconnection policy from a given string.
|
static Properties |
parseURL(String url)
Parses a URL for the Cassandra JDBC Driver.
|
public static final int DEFAULT_PORT
public static final int DEFAULT_AWS_PORT
public static final String PROTOCOL
public static final String PROTOCOL_DBAAS
PROTOCOL_ASTRA for connections to AstraDB. The support of "jdbc:cassandra:dbaas:"
protocol will be removed in a future version.public static final String PROTOCOL_ASTRA
public static final String PROTOCOL_AWS
This is required to retrieve password from the Amazon Secrets manager and to use Amazon SigV4 auth provider.
public static final String KEY_CONSISTENCY
public static final String TAG_CONSISTENCY_LEVEL
consistency.public static final String KEY_SERIAL_CONSISTENCY
public static final String TAG_SERIAL_CONSISTENCY_LEVEL
serialconsistency.public static final String KEY_FETCH_SIZE
public static final String TAG_FETCH_SIZE
fetchsize.public static final String KEY_LOAD_BALANCING_POLICY
public static final String TAG_LOAD_BALANCING_POLICY
loadbalancing.public static final String KEY_LOCAL_DATACENTER
public static final String TAG_LOCAL_DATACENTER
localdatacenter.public static final String KEY_RETRY_POLICY
public static final String TAG_RETRY_POLICY
retry.public static final String KEY_RECONNECT_POLICY
public static final String TAG_RECONNECT_POLICY
reconnection.public static final String KEY_DEBUG
public static final String TAG_DEBUG
debug.public static final String KEY_ENABLE_SSL
public static final String TAG_ENABLE_SSL
enablessl.public static final String KEY_SSL_ENGINE_FACTORY
SslEngineFactory).public static final String TAG_SSL_ENGINE_FACTORY
sslenginefactory.public static final String KEY_SSL_HOSTNAME_VERIFICATION
public static final String TAG_SSL_HOSTNAME_VERIFICATION
hostnameverification.public static final String KEY_CLOUD_SECURE_CONNECT_BUNDLE
public static final String TAG_CLOUD_SECURE_CONNECT_BUNDLE
secureconnectbundle.public static final String KEY_USER
public static final String TAG_USER
user.public static final String KEY_PASSWORD
public static final String TAG_PASSWORD
password.public static final String KEY_USE_KERBEROS
public static final String TAG_USE_KERBEROS
usekrb5.public static final String KEY_REQUEST_TIMEOUT
public static final String TAG_REQUEST_TIMEOUT
requesttimeout.public static final String KEY_CONNECT_TIMEOUT
public static final String TAG_CONNECT_TIMEOUT
connecttimeout.public static final String KEY_TCP_NO_DELAY
public static final String TAG_TCP_NO_DELAY
tcpnodelay.public static final String KEY_KEEP_ALIVE
public static final String TAG_KEEP_ALIVE
keepalive.public static final String KEY_CONFIG_FILE
public static final String TAG_CONFIG_FILE
configfile.public static final String KEY_COMPLIANCE_MODE
public static final String TAG_COMPLIANCE_MODE
compliancemode.public static final String TAG_DATABASE_NAME
public static final String TAG_CONTACT_POINTS
public static final String TAG_ASTRA_DATABASE_NAME
public static final String TAG_ACTIVE_PROFILE
activeprofile.public static final String KEY_ACTIVE_PROFILE
public static final String KEY_AWS_SECRET_NAME
public static final String TAG_AWS_SECRET_NAME
awssecret.public static final String KEY_AWS_SECRET_REGION
public static final String TAG_AWS_SECRET_REGION
awssecretregion.public static final String KEY_AWS_REGION
public static final String TAG_AWS_REGION
awsregion.public static final String KEY_USE_SIG_V4
public static final String TAG_USE_SIG_V4
usesigv4.public static final String KEY_TOKEN
public static final String TAG_TOKEN
token.public static final String KEY_ASTRA_REGION
public static final String TAG_ASTRA_REGION
astraregion.public static final String TAG_DBAAS_CONNECTION
PROTOCOL_ASTRA for connections to AstraDB. The support of "jdbc:cassandra:dbaas:"
protocol will be removed in a future version.PROTOCOL_DBAAS).public static final String TAG_ASTRA_CONNECTION
PROTOCOL_ASTRA).public static final String TAG_AWS_CONNECTION
PROTOCOL_AWS).public static final String KEY_CUSTOM_CODECS
public static final String TAG_CUSTOM_CODECS
customcodecs.public static Properties parseURL(String url) throws SQLException
The URL must start with the protocol "jdbc:cassandra:" or "jdbc:cassandra:dbaas:" for a connection to a cloud database. The URI part (the "sub-name") must contain a host, an optional port and optional keyspace name, for example: "//localhost:9160/Test1", except for a connection to a cloud database, in this case, a simple keyspace with a secure connect bundle is sufficient, for example: "///Test1?secureconnectbundle=/path/to/bundle.zip".
url - The full JDBC URL to be parsed.SQLException - when something went wrong during the URL parsing.SQLSyntaxErrorException - when the URL syntax is invalid.SQLNonTransientConnectionException - when the host is missing in the URL.public static String createSubName(Properties props) throws SQLException
props - A Properties instance containing all the properties to be considered.SQLException - when something went wrong during the "sub-name" creation.SQLNonTransientConnectionException - when the host name is missing.public static Map<com.datastax.oss.driver.api.core.config.DriverOption,Object> parseReconnectionPolicy(String reconnectionPolicyString)
reconnectionPolicyString - The string containing the reconnection policy value.DriverOption values parsed from the given string.public static List<com.datastax.oss.driver.api.core.type.codec.TypeCodec<?>> parseCustomCodecs(String customCodecs)
customCodecs - The string containing the custom codecs class names to instantiate.Copyright © 2020–2026 ING Bank. All rights reserved.