Class MySQL
java.lang.Object
io.github.suppierk.codegen.docker.AbstractDatabaseContainer
io.github.suppierk.codegen.docker.MySQL
- All Implemented Interfaces:
AutoCloseable
Testcontainers-backed MySQL database used when schemas declare either the modern or legacy MySQL
driver. Provides a specialised container implementation that can resolve the JDBC driver from a
supplied class loader.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a MySQL Testcontainer using supplied Docker image and default class loader.MySQL(String dockerImageName, ClassLoader driverClassLoader) Creates a MySQL Testcontainer using supplied Docker image and explicit driver loader. -
Method Summary
Modifier and TypeMethodDescriptionProvides database driver Java class namestatic booleansupportsDriverClassName(String driverClassName) Verifies whether provided driver class name is supported by this container.Methods inherited from class io.github.suppierk.codegen.docker.AbstractDatabaseContainer
close, getDatabaseContainer, getJdbcUrl, getPassword, getUsername
-
Constructor Details
-
MySQL
Creates a MySQL Testcontainer using supplied Docker image and default class loader.- Parameters:
dockerImageName- Docker tag to launch
-
MySQL
Creates a MySQL Testcontainer using supplied Docker image and explicit driver loader.- Parameters:
dockerImageName- Docker tag to launchdriverClassLoader-ClassLoadercapable of resolving the JDBC driver
-
-
Method Details
-
supportsDriverClassName
Verifies whether provided driver class name is supported by this container.- Parameters:
driverClassName- used in Flyway / jOOQ Gradle configurations- Returns:
trueif current implementation supports given driver,falseotherwise
-
getDriverClassName
Description copied from class:AbstractDatabaseContainerProvides database driver Java class name- Overrides:
getDriverClassNamein classAbstractDatabaseContainer- Returns:
- database driver Java class name
-