public final class Utils
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DISCONNECTION_SQL_CODE_PREFIX
Any SQL_STATE starting with this value is considered a fatal disconnect
|
static java.util.Set<java.lang.String> |
DISCONNECTION_SQL_CODES
SQL codes of fatal connection errors.
|
static boolean |
IS_SECURITY_ENABLED
Whether the security manager is enabled.
|
Modifier and Type | Method and Description |
---|---|
static void |
closeQuietly(java.sql.Connection connection)
Closes the Connection (which may be null).
|
static void |
closeQuietly(java.sql.ResultSet resultSet)
Closes the ResultSet (which may be null).
|
static void |
closeQuietly(java.sql.Statement statement)
Closes the Statement (which may be null).
|
static java.lang.String |
getMessage(java.lang.String key)
Gets the correct i18n message for the given key.
|
static java.lang.String |
getMessage(java.lang.String key,
java.lang.Object... args)
Gets the correct i18n message for the given key with placeholders replaced by the supplied arguments.
|
static char[] |
toCharArray(java.lang.String value)
Converts the given String to a char[].
|
static java.lang.String |
toString(char[] value)
Converts the given char[] to a String.
|
public static final boolean IS_SECURITY_ENABLED
public static final java.lang.String DISCONNECTION_SQL_CODE_PREFIX
public static final java.util.Set<java.lang.String> DISCONNECTION_SQL_CODES
public static void closeQuietly(java.sql.ResultSet resultSet)
resultSet
- a ResultSet, may be null
public static void closeQuietly(java.sql.Connection connection)
connection
- a Connection, may be null
public static void closeQuietly(java.sql.Statement statement)
statement
- a Statement, may be null
.public static java.lang.String getMessage(java.lang.String key)
key
- The key to look up an i18n message.public static java.lang.String getMessage(java.lang.String key, java.lang.Object... args)
key
- A message key.args
- The message arguments.public static char[] toCharArray(java.lang.String value)
value
- may be null.public static java.lang.String toString(char[] value)
value
- may be null.Copyright © 2000-2018 Apache Software Foundation. All Rights Reserved.