public class

DatabaseUtil

extends Object
java.lang.Object
   ↳ com.atlassian.jira.database.DatabaseUtil

Summary

Public Constructors
DatabaseUtil()
Public Methods
static String booleanToChar1(Boolean indicator)
Converts a boolean value into a String value to be stored in a CHAR(1) DB column.
static void closeQuietly(Connection con)
Closes the given connection if any.
static void closeQuietly(ResultSet rs)
Closes the given ResultSet if any.
static void closeQuietly(Statement stmt)
Closes the given Statement if any.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public DatabaseUtil ()

Public Methods

public static String booleanToChar1 (Boolean indicator)

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" feild-type to store a boolean flag.

Parameters
indicator the Boolean value
Returns
  • "Y", "N", or null accordingly.

public static void closeQuietly (Connection con)

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

public static void closeQuietly (ResultSet rs)

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

public static void closeQuietly (Statement stmt)

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