public class ConnectionUtils
extends java.lang.Object
HostInfo objects.| Constructor and Description |
|---|
ConnectionUtils() |
| Modifier and Type | Method and Description |
|---|---|
static HostInfo |
copyWithAdditionalProps(HostInfo baseHostInfo,
ConnectionUrl connectionUrl)
Create a copy of
HostInfo object where host and port are the same while all others are from ConnectionUrl object. |
static HostInfo |
copyWithAdditionalProps(HostInfo baseHostInfo,
HostInfo newHostInfo) |
static HostInfo |
copyWithAdditionalProps(HostInfo baseHostInfo,
java.util.Map<java.lang.String,java.lang.String> additionalProps)
Create a copy of the given
HostInfo object where all details are the same except for the host properties,
which will contain both the original properties and the properties passed into the function. |
static boolean |
isNetworkException(java.sql.SQLException exception)
Check whether the given exception is caused by network errors.
|
static boolean |
isNetworkException(java.lang.String sqlState)
Check whether the given SQLState is caused by network errors.
|
public static HostInfo copyWithAdditionalProps(HostInfo baseHostInfo, java.util.Map<java.lang.String,java.lang.String> additionalProps)
HostInfo object where all details are the same except for the host properties,
which will contain both the original properties and the properties passed into the function.baseHostInfo - The HostInfo object to copyadditionalProps - The map of properties to add to the new HostInfo copyHostInfo object where all details are the same except for the host properties,
will contain both the original properties and the properties passed into the function. Returns null if
baseHostInfo is nullpublic static HostInfo copyWithAdditionalProps(HostInfo baseHostInfo, ConnectionUrl connectionUrl)
HostInfo object where host and port are the same while all others are from ConnectionUrl object.baseHostInfo - The HostInfo object to copy host and port fromconnectionUrl - All other properties to add to the new HostInfoHostInfo object where host and port are the same while all others are from ConnectionUrl object
Returns baseHostInfo if connectionUrl is null
Returns connectionUrl's HostInfo if baseHostInfo is nullpublic static HostInfo copyWithAdditionalProps(HostInfo baseHostInfo, HostInfo newHostInfo)
public static boolean isNetworkException(java.sql.SQLException exception)
exception - The SQLException raised by the driver.public static boolean isNetworkException(java.lang.String sqlState)
sqlState - The SQLState of an exception raised by the driver.