public final class Utils extends Object
Modifier and Type | Field and Description |
---|---|
static String |
DISCONNECTION_SQL_CODE_PREFIX
Any SQL_STATE starting with this value is considered a fatal disconnect
|
static Set<String> |
DISCONNECTION_SQL_CODES
SQL codes of fatal connection errors.
|
static boolean |
IS_SECURITY_ENABLED
Deprecated.
No replacement.
|
Modifier and Type | Method and Description |
---|---|
static char[] |
clone(char[] value)
Clones the given char[] if not null.
|
static Properties |
cloneWithoutCredentials(Properties properties)
Clones the given
Properties without the standard "user" or "password" entries. |
static void |
closeQuietly(AutoCloseable autoCloseable)
Closes the AutoCloseable (which may be null).
|
static void |
closeQuietly(Connection connection)
Deprecated.
|
static void |
closeQuietly(ResultSet resultSet)
Deprecated.
|
static void |
closeQuietly(Statement statement)
Deprecated.
|
static String |
getMessage(String key)
Gets the correct i18n message for the given key.
|
static String |
getMessage(String key,
Object... args)
Gets the correct i18n message for the given key with placeholders replaced by the supplied arguments.
|
static char[] |
toCharArray(String value)
Converts the given String to a char[].
|
static String |
toString(char[] value)
Converts the given char[] to a String.
|
@Deprecated public static final boolean IS_SECURITY_ENABLED
public static final String DISCONNECTION_SQL_CODE_PREFIX
public static char[] clone(char[] value)
value
- may be null.public static Properties cloneWithoutCredentials(Properties properties)
Properties
without the standard "user" or "password" entries.properties
- may be nullpublic static void closeQuietly(AutoCloseable autoCloseable)
autoCloseable
- an AutoCloseable, may be null
@Deprecated public static void closeQuietly(Connection connection)
closeQuietly(AutoCloseable)
.connection
- a Connection, may be null
@Deprecated public static void closeQuietly(ResultSet resultSet)
closeQuietly(AutoCloseable)
.resultSet
- a ResultSet, may be null
@Deprecated public static void closeQuietly(Statement statement)
closeQuietly(AutoCloseable)
.statement
- a Statement, may be null
.public static String getMessage(String key)
key
- The key to look up an i18n message.public static String getMessage(String key, Object... args)
key
- A message key.args
- The message arguments.public static char[] toCharArray(String value)
value
- may be null.public static String toString(char[] value)
value
- may be null.Copyright © 2001–2020 The Apache Software Foundation. All rights reserved.