Package org.testcontainers.delegate
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Close connection to the database Overridden to suppress throwing Exceptionprotected abstract void
closeConnectionQuietly
(CONNECTION connection) Quietly close the connectionprotected abstract CONNECTION
Template method for creating new connections to the databasevoid
execute
(Collection<String> statements, String scriptPath, boolean continueOnError, boolean ignoreFailedDrops) Execute collection of statementsprotected CONNECTION
Get or create new connection to the databaseMethods 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
-
AbstractDatabaseDelegate
public AbstractDatabaseDelegate()
-
-
Method Details
-
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 interfaceDatabaseDelegate
-
close
public void close()Description copied from interface:DatabaseDelegate
Close connection to the database Overridden to suppress throwing Exception- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceDatabaseDelegate
-
closeConnectionQuietly
Quietly close the connection -
createNewConnection
Template method for creating new connections to the database
-