Class Utils
java.lang.Object
org.apache.commons.dbcp2.Utils
Utility methods.
- Since:
- 2.0
- Version:
- $Id: Utils.java 1680126 2015-05-18 23:22:01Z ggregory $
-
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 boolean -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcloseQuietly(Connection conn) Closes the Connection (which may be null).static voidcloseQuietly(ResultSet rset) Closes the ResultSet (which may be null).static voidcloseQuietly(Statement stmt) Closes the Statement (which may be null).static StringgetMessage(String key) Obtain the correct i18n message for the given key.static StringgetMessage(String key, Object... args) Obtain the correct i18n message for the given key with placeholders replaced by the supplied arguments.
-
Field Details
-
IS_SECURITY_ENABLED
public static final boolean IS_SECURITY_ENABLED -
DISCONNECTION_SQL_CODE_PREFIX
Any SQL_STATE starting with this value is considered a fatal disconnect- See Also:
-
DISCONNECTION_SQL_CODES
-
-
Method Details
-
closeQuietly
Closes the ResultSet (which may be null).- Parameters:
rset- a ResultSet, may benull
-
closeQuietly
Closes the Connection (which may be null).- Parameters:
conn- a Connection, may benull
-
closeQuietly
Closes the Statement (which may be null).- Parameters:
stmt- a Statement, may benull
-
getMessage
-
getMessage
-