Class Utils
java.lang.Object
org.datanucleus.store.rdbms.datasource.dbcp2.Utils
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringAny SQL_STATE starting with this value is considered a fatal disconnectSQL codes of fatal connection errors.static final booleanWhether the security manager is enabled.private static final ResourceBundle -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic char[]clone(char[] value) Clones the given char[] if not null.static voidcloseQuietly(AutoCloseable autoCloseable) Closes the AutoCloseable (which may be null).static voidcloseQuietly(Connection connection) Closes the Connection (which may be null).static voidcloseQuietly(ResultSet resultSet) Closes the ResultSet (which may be null).static voidcloseQuietly(Statement statement) Closes the Statement (which may be null).static StringgetMessage(String key) Gets the correct i18n message for the given key.static StringgetMessage(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 StringtoString(char[] value) Converts the given char[] to a String.
-
Field Details
-
messages
-
IS_SECURITY_ENABLED
public static final boolean IS_SECURITY_ENABLEDWhether the security manager is enabled. -
DISCONNECTION_SQL_CODE_PREFIX
Any SQL_STATE starting with this value is considered a fatal disconnect- See Also:
-
DISCONNECTION_SQL_CODES
-
-
Constructor Details
-
Utils
private Utils()
-
-
Method Details
-
clone
public static char[] clone(char[] value) Clones the given char[] if not null.- Parameters:
value- may be null.- Returns:
- a cloned char[] or null.
-
closeQuietly
Closes the AutoCloseable (which may be null).- Parameters:
autoCloseable- an AutoCloseable, may benull- Since:
- 2.6.0
-
closeQuietly
Closes the Connection (which may be null).- Parameters:
connection- a Connection, may benull
-
closeQuietly
Closes the ResultSet (which may be null).- Parameters:
resultSet- a ResultSet, may benull
-
closeQuietly
Closes the Statement (which may be null).- Parameters:
statement- a Statement, may benull.
-
getMessage
-
getMessage
-
toCharArray
Converts the given String to a char[].- Parameters:
value- may be null.- Returns:
- a char[] or null.
-
toString
Converts the given char[] to a String.- Parameters:
value- may be null.- Returns:
- a String or null.
-