Package com.atlassian.jira.database
Class DatabaseUtil
java.lang.Object
com.atlassian.jira.database.DatabaseUtil
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringbooleanToChar1(Boolean indicator) Converts a boolean value into a String value to be stored in a CHAR(1) DB column.static voidProgrammer's note: This method was called kickOfBizInTheGuts.static voidcloseQuietly(Connection con) Closes the given connection if any.static voidCloses the given ResultSet if any.static voidcloseQuietly(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...
-