Package com.atlassian.jira.database
Interface ConnectionProvider
public interface ConnectionProvider
- Since:
- v7.0.6
-
Method Summary
Modifier and TypeMethodDescriptionvoid
execute
(SqlCallback callback) Executes SQL statements as defined in the callback function.<T> T
executeQuery
(QueryCallback<T> callback) Executes SQL statements as defined in the callback function and returns the results.
-
Method Details
-
executeQuery
Executes SQL statements as defined in the callback function and returns the results.This method is mostly useful for running SELECT statements and returning the given results in some form. Executes SQL statements as defined in the callback function and manages transaction semantics.
Transaction semantics for this method will depend on how you aquired the ConnectionProvider - see appropriate javadoc there eg
QueryDslAccessor.withNewConnection()
.- Type Parameters:
T
- type of results- Parameters:
callback
- the callback function that runs the query- Returns:
- results of the callback function
- Since:
- 7.0.6
-
execute
Executes SQL statements as defined in the callback function.This method does not return results and is mostly useful for running INSERT, UPDATE, and DELETE operations.
Transaction semantics for this method will depend on how you aquired the ConnectionProvider - see appropriate javadoc there eg
QueryDslAccessor.withNewConnection()
.- Parameters:
callback
- the callback function that runs the query- Since:
- 7.0.6
-