Class FHIRDbTestConnectionStrategy

  • All Implemented Interfaces:
    FHIRDbConnectionStrategy

    public class FHIRDbTestConnectionStrategy
    extends java.lang.Object
    implements FHIRDbConnectionStrategy
    Hides the logic behind obtaining a JDBC Connection from the DAO code. This strategy object is local to a thread, and because we use the same underlying connection to our test database within a transaction, we only need to configure the connection once. We can track this initialization with nothing more complicated than a Boolean flag. Use by unit tests or other scenarios where connections are obtained using an IConnectionProvider implementation, outside the scope of a JEE container. For example, this is used when connecting to in-memory instances of Derby when running persistence layer unit-tests.