public interface

DatabaseConnection

com.atlassian.jira.database.DatabaseConnection

Class Overview

A handle to a Database Connection obtained from JIRA's connection pool.

See Also

Summary

Public Methods
void commit()
Commits all changes made since the previous commit or rollback.
Connection getJdbcConnection()
Returns the JDBC connection wrapped by this object.
void rollback()
Undoes all changes made in the current transaction.
void setAutoCommit(boolean autoCommit)
Convenience method to set autocommit mode on the database connection without the annoying SQLException.

Public Methods

public void commit ()

Commits all changes made since the previous commit or rollback. This method should be used only when auto-commit mode has been disabled.

Throws
DataAccessException a RuntimeException wrapping any underlying SQLException.

public Connection getJdbcConnection ()

Returns the JDBC connection wrapped by this object.

Returns
  • the JDBC connection wrapped by this object.

public void rollback ()

Undoes all changes made in the current transaction. This method should be used only when auto-commit mode has been disabled. You normally don't need to call this explicitly - instead throwing a RuntimeException will indicate to DatabaseAccessor that you want to rollback.

Throws
DataAccessException a RuntimeException wrapping any underlying SQLException.

public void setAutoCommit (boolean autoCommit)

Convenience method to set autocommit mode on the database connection without the annoying SQLException.

Parameters
autoCommit true to enable auto-commit mode, false to disable it
Throws
DataAccessException a RuntimeException wrapping any underlying SQLException.