Package scriptella.jdbc
Class JdbcUtils
java.lang.Object
scriptella.jdbc.JdbcUtils
Utility class JDBC related operations.
- Version:
- 1.0
- Author:
- Fyodor Kupolov
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidcloseSilent(Connection con) Silently closes a connection.static voidcloseSilent(ResultSet rs) Silently closes a result set.static voidSilently closes a statement.static StringgetUrlDescription(URL url) Returns a credential-safe description of an input/output URL.static ThrowableCopies an exception graph with source URL credentials removed from messages.
-
Method Details
-
getUrlDescription
Returns a credential-safe description of an input/output URL. Only the protocol is included; authority, path, query and fragment are omitted.- Parameters:
url- resolved URL, or null for console I/O- Returns:
- a source description without connection details
-
sanitize
Copies an exception graph with source URL credentials removed from messages. Causes, suppressed exceptions, stack traces and SQL diagnostics are retained; repeated/cyclic references never attach an original exception to the copy.- Parameters:
source- exception to reporturl- source URL, or null for console I/O- Returns:
- sanitized diagnostic copy
-
closeSilent
Silently closes a connection.- Parameters:
con- connection to close. Nulls allowed.
-
closeSilent
Silently closes a statement.- Parameters:
s- statement to close. Nulls allowed.
-
closeSilent
Silently closes a result set.- Parameters:
rs- result set to close. Nulls allowed.
-