Package com.mysql.cj.conf
Enum ConnectionUrl.Type
java.lang.Object
java.lang.Enum<ConnectionUrl.Type>
com.mysql.cj.conf.ConnectionUrl.Type
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<ConnectionUrl.Type>,java.lang.constant.Constable
- Enclosing class:
- ConnectionUrl
public static enum ConnectionUrl.Type extends java.lang.Enum<ConnectionUrl.Type>
The database URL type which is determined by the scheme section of the connection string.
-
Nested Class Summary
-
Enum Constant Summary
-
Method Summary
Modifier and Type Method Description static ConnectionUrl.TypefromValue(java.lang.String scheme, int n)Returns theConnectionUrl.Typecorresponding to the given scheme and number of hosts, if any.ConnectionUrl.TypegetAlternateDnsSrvType()ConnectionUrl.HostsCardinalitygetCardinality()static ConnectionUrlgetConnectionUrlInstance(ConnectionUrlParser parser, java.util.Properties info)Instantiates a class that implements the right type of connection URLs for the givenConnectionUrlParser.PropertyKeygetDnsSrvPropertyKey()java.lang.StringgetImplementingClass()java.lang.StringgetScheme()static booleanisSupported(java.lang.String scheme)Checks if the given scheme corresponds to one of the connection types the driver supports.static ConnectionUrl.TypevalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static ConnectionUrl.Type[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException- if this enum type has no constant with the specified namejava.lang.NullPointerException- if the argument is null
-
getScheme
public java.lang.String getScheme() -
getCardinality
-
getImplementingClass
public java.lang.String getImplementingClass() -
getDnsSrvPropertyKey
-
getAlternateDnsSrvType
-
fromValue
Returns theConnectionUrl.Typecorresponding to the given scheme and number of hosts, if any. Otherwise throws anUnsupportedConnectionStringException. Calling this method with the argument n lower than 0 skips the hosts cardinality validation.- Parameters:
scheme- one of supported schemesn- the number of hosts in the database URL- Returns:
- the
ConnectionUrl.Typecorresponding to the given protocol and number of hosts
-
getConnectionUrlInstance
public static ConnectionUrl getConnectionUrlInstance(ConnectionUrlParser parser, java.util.Properties info)Instantiates a class that implements the right type of connection URLs for the givenConnectionUrlParser.- Parameters:
parser- theConnectionUrlParsercontaining the URL components.info- a connection properties map to add to theConnectionUrlstructure.- Returns:
- an instance of
ConnectionUrl.
-
isSupported
public static boolean isSupported(java.lang.String scheme)Checks if the given scheme corresponds to one of the connection types the driver supports.- Parameters:
scheme- scheme part from connection string, like "jdbc:mysql:"- Returns:
- true if the given scheme is supported by driver
-