Class AbstractDatabaseDelegate<CONNECTION>

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

public abstract class AbstractDatabaseDelegate<CONNECTION>
extends java.lang.Object
implements DatabaseDelegate
  • Constructor Summary

    Constructors 
    Constructor Description
    AbstractDatabaseDelegate()  
  • Method Summary

    Modifier and Type Method Description
    void close()
    Close connection to the database Overridden to suppress throwing Exception
    protected abstract void closeConnectionQuietly​(CONNECTION connection)
    Quietly close the connection
    protected abstract CONNECTION createNewConnection()
    Template method for creating new connections to the database
    void execute​(java.util.Collection<java.lang.String> statements, java.lang.String scriptPath, boolean continueOnError, boolean ignoreFailedDrops)
    Execute collection of statements
    protected CONNECTION getConnection()
    Get or create new connection to the database

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.testcontainers.delegate.DatabaseDelegate

    execute
  • Constructor Details

  • Method Details

    • getConnection

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

      public void execute​(java.util.Collection<java.lang.String> statements, java.lang.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 java.lang.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