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:
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 voidclose()Close connection to the database Overridden to suppress throwing Exceptionprotected abstract voidcloseConnectionQuietly(CONNECTION connection)Quietly close the connectionprotected abstract CONNECTIONcreateNewConnection()Template method for creating new connections to the databasevoidexecute(java.util.Collection<java.lang.String> statements, java.lang.String scriptPath, boolean continueOnError, boolean ignoreFailedDrops)Execute collection of statementsprotected CONNECTIONgetConnection()Get or create new connection to the database
-
Constructor Details
-
AbstractDatabaseDelegate
public AbstractDatabaseDelegate()
-
-
Method Details
-
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:DatabaseDelegateExecute collection of statements- Specified by:
executein interfaceDatabaseDelegate
-
close
public void close()Description copied from interface:DatabaseDelegateClose connection to the database Overridden to suppress throwing Exception- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfaceDatabaseDelegate
-
closeConnectionQuietly
Quietly close the connection -
createNewConnection
Template method for creating new connections to the database
-