Package com.atlassian.jira.database
Class DatabaseUtil
java.lang.Object
com.atlassian.jira.database.DatabaseUtil
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String
booleanToChar1
(Boolean indicator) Converts a boolean value into a String value to be stored in a CHAR(1) DB column.static void
Programmer's note: This method was called kickOfBizInTheGuts.static void
closeQuietly
(Connection con) Closes the given connection if any.static void
Closes the given ResultSet if any.static void
closeQuietly
(Statement stmt) Closes the given Statement if any.
-
Constructor Details
-
DatabaseUtil
public DatabaseUtil()
-
-
Method Details
-
closeQuietly
Closes the given connection if any. If null is passed, it does nothing and if SQLExceptions happen on close, they are swallowed.- Parameters:
con
- a Connection to be closed, potentially null
-
closeQuietly
Closes the given Statement if any. If null is passed, it does nothing and if SQLExceptions happen on close, they are swallowed.- Parameters:
stmt
- a Statement to be closed, potentially null
-
closeQuietly
Closes the given ResultSet if any. If null is passed, it does nothing and if SQLExceptions happen on close, they are swallowed.- Parameters:
rs
- a ResultSet to be closed, potentially null
-
booleanToChar1
Converts a boolean value into a String value to be stored in a CHAR(1) DB column.This is useful when using the OfBiz "indicator" field-type to store a boolean flag.
- Parameters:
indicator
- the Boolean value- Returns:
- "Y", "N", or null accordingly.
-
cleanOfBizSchema
public static void cleanOfBizSchema()Programmer's note: This method was called kickOfBizInTheGuts. Came fromDatabaseLauncher
. Leaving a comment to provide historical accuracy. This method reruns ofBiz DDL tasks. It creates missing indexes, tables, etc...
-