Package org.apache.tomcat.dbcp.dbcp2
Class Utils
- java.lang.Object
- 
- org.apache.tomcat.dbcp.dbcp2.Utils
 
- 
 public final class Utils extends java.lang.ObjectUtility methods.- Since:
- 2.0
 
- 
- 
Field SummaryFields Modifier and Type Field Description static java.lang.StringDISCONNECTION_SQL_CODE_PREFIXAny SQL_STATE starting with this value is considered a fatal disconnectstatic java.util.Set<java.lang.String>DISCONNECTION_SQL_CODESSQL codes of fatal connection errors.static booleanIS_SECURITY_ENABLEDWhether the security manager is enabled.
 - 
Method SummaryAll Methods Static Methods Concrete Methods Modifier and Type Method Description static char[]clone(char[] value)Clones the given char[] if not null.static java.util.PropertiescloneWithoutCredentials(java.util.Properties properties)Clones the givenPropertieswithout the standard "user" or "password" entries.static voidcloseQuietly(java.lang.AutoCloseable autoCloseable)Closes the AutoCloseable (which may be null).static java.lang.StringgetMessage(java.lang.String key)Gets the correct i18n message for the given key.static java.lang.StringgetMessage(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.StringtoString(char[] value)Converts the given char[] to a String.
 
- 
- 
- 
Field Detail- 
IS_SECURITY_ENABLEDpublic static final boolean IS_SECURITY_ENABLED Whether the security manager is enabled.
 - 
DISCONNECTION_SQL_CODE_PREFIXpublic static final java.lang.String DISCONNECTION_SQL_CODE_PREFIX Any SQL_STATE starting with this value is considered a fatal disconnect- See Also:
- Constant Field Values
 
 - 
DISCONNECTION_SQL_CODESpublic static final java.util.Set<java.lang.String> DISCONNECTION_SQL_CODES SQL codes of fatal connection errors.- 57P01 (Admin shutdown)
- 57P02 (Crash shutdown)
- 57P03 (Cannot connect now)
- 01002 (SQL92 disconnect error)
- JZ0C0 (Sybase disconnect error)
- JZ0C1 (Sybase disconnect error)
 
 
- 
 - 
Method Detail- 
clonepublic static char[] clone(char[] value) Clones the given char[] if not null.- Parameters:
- value- may be null.
- Returns:
- a cloned char[] or null.
 
 - 
cloneWithoutCredentialspublic static java.util.Properties cloneWithoutCredentials(java.util.Properties properties) Clones the givenPropertieswithout the standard "user" or "password" entries.- Parameters:
- properties- may be null
- Returns:
- a clone of the input without the standard "user" or "password" entries.
- Since:
- 2.8.0
 
 - 
closeQuietlypublic static void closeQuietly(java.lang.AutoCloseable autoCloseable) Closes the AutoCloseable (which may be null).- Parameters:
- autoCloseable- an AutoCloseable, may be- null
- Since:
- 2.6.0
 
 - 
getMessagepublic static java.lang.String getMessage(java.lang.String key) Gets the correct i18n message for the given key.- Parameters:
- key- The key to look up an i18n message.
- Returns:
- The i18n message.
 
 - 
getMessagepublic 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.- Parameters:
- key- A message key.
- args- The message arguments.
- Returns:
- An i18n message.
 
 - 
toCharArraypublic static char[] toCharArray(java.lang.String value) Converts the given String to a char[].- Parameters:
- value- may be null.
- Returns:
- a char[] or null.
 
 - 
toStringpublic static java.lang.String toString(char[] value) Converts the given char[] to a String.- Parameters:
- value- may be null.
- Returns:
- a String or null.
 
 
- 
 
-