Class AbstractDatabaseDelegate<CONNECTION>

java.lang.Object
org.testcontainers.delegate.AbstractDatabaseDelegate<CONNECTION>
Type Parameters:
CONNECTION - connection to the database
All Implemented Interfaces:
AutoCloseable, DatabaseDelegate

public abstract class AbstractDatabaseDelegate<CONNECTION> extends Object implements DatabaseDelegate
  • Constructor Details

    • AbstractDatabaseDelegate

      public AbstractDatabaseDelegate()
  • Method Details

    • getConnection

      protected CONNECTION getConnection()
      Get or create new connection to the database
    • execute

      public void execute(Collection<String> statements, String scriptPath, boolean continueOnError, boolean ignoreFailedDrops)
      Description copied from interface: DatabaseDelegate
      Execute collection of statements
      Specified by:
      execute in interface DatabaseDelegate
    • close

      public void close()
      Description copied from interface: DatabaseDelegate
      Close connection to the database Overridden to suppress throwing Exception
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface DatabaseDelegate
    • closeConnectionQuietly

      protected abstract void closeConnectionQuietly(CONNECTION connection)
      Quietly close the connection
    • createNewConnection

      protected abstract CONNECTION createNewConnection()
      Template method for creating new connections to the database