Interface FHIRDbConnectionStrategy
-
- All Known Implementing Classes:
FHIRDbConnectionStrategyBase,FHIRDbTenantDatasourceConnectionStrategy,FHIRDbTestConnectionStrategy
public interface FHIRDbConnectionStrategyAbstraction used to obtain JDBC connections. The database being connected is determined by the datasource currently referenced by theFHIRRequestContext(which is a ThreadLocal thing, and not obvious).
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidapplySearchOptimizerOptions(java.sql.Connection c, boolean isCompartment)Apply any optimizer options configured to improve search query performance See issue-1911 for details.java.sql.ConnectiongetConnection()Get a connection to the desired data source identified by the currentFHIRRequestContextFHIRDbFlavorgetFlavor()Get the flavor of the database we are working with to reveal its capabilitiesQueryHintsgetQueryHints()Append the given hint to FHIR search queries
-
-
-
Method Detail
-
getConnection
java.sql.Connection getConnection() throws FHIRPersistenceDBConnectExceptionGet a connection to the desired data source identified by the currentFHIRRequestContext- Returns:
- a
Connection. Never null. - Throws:
FHIRPersistenceDBConnectException
-
getFlavor
FHIRDbFlavor getFlavor() throws FHIRPersistenceDataAccessException
Get the flavor of the database we are working with to reveal its capabilities- Returns:
- the datastore/source flavor from the FHIR configuration
- Throws:
FHIRPersistenceDataAccessException- if there is an issue with the configuration
-
getQueryHints
QueryHints getQueryHints()
Append the given hint to FHIR search queries- Returns:
-
applySearchOptimizerOptions
void applySearchOptimizerOptions(java.sql.Connection c, boolean isCompartment)Apply any optimizer options configured to improve search query performance See issue-1911 for details.- Parameters:
c- the connection to be configuredisCompartment- true if the query is a compartment-based search
-
-