public abstract class JdbcDatabaseContainer<SELF extends JdbcDatabaseContainer<SELF>> extends GenericContainer<SELF> implements LinkableContainer
GenericContainer.AbstractWaitStrategy
Container.ExecResult
Modifier and Type | Field and Description |
---|---|
protected Map<String,String> |
parameters |
CONTAINER_RUNNING_TIMEOUT_SEC, containerId, containerName, dockerClient, dockerDaemonInfo, waitStrategy
Constructor and Description |
---|
JdbcDatabaseContainer(String dockerImageName) |
Modifier and Type | Method and Description |
---|---|
void |
addParameter(String paramName,
String value) |
Connection |
createConnection(String queryString)
Creates a connection to the underlying containerized database instance.
|
protected abstract String |
getDriverClassName() |
Driver |
getJdbcDriverInstance()
Obtain an instance of the correct JDBC driver for this particular database container type
|
abstract String |
getJdbcUrl() |
protected abstract Integer |
getLivenessCheckPort() |
abstract String |
getPassword() |
protected abstract String |
getTestQueryString() |
abstract String |
getUsername() |
protected void |
optionallyMapResourceParameterAsVolume(String paramName,
String pathNameInContainer,
String defaultResource) |
void |
setParameters(Map<String,String> parameters) |
protected void |
waitUntilContainerStarted() |
addEnv, addExposedPort, addExposedPorts, addFileSystemBind, addFixedExposedPort, addLink, canEqual, close, configure, containerIsStarted, containerIsStarting, createVolumeDirectory, equals, execInContainer, execInContainer, fetchDockerDaemonInfo, finished, followOutput, followOutput, getBinds, getCommandParts, getContainerId, getContainerInfo, getContainerIpAddress, getContainerName, getCreateContainerCmdModifiers, getDockerClient, getDockerDaemonInfo, getDockerImageName, getEnv, getExposedPorts, getExtraHosts, getImage, getIpAddress, getLinkedContainers, getLogConsumers, getMappedPort, getNetwork, getNetworkAliases, getNetworkMode, getPortBindings, getStartupAttempts, getStartupCheckStrategy, getTestHostIpAddress, getVolumesFroms, getWaitStrategy, getWorkingDirectory, hashCode, isPrivilegedMode, isRunning, logger, setBinds, setCommand, setCommand, setCommandParts, setDockerImageName, setEnv, setExposedPorts, setExtraHosts, setImage, setLinkedContainers, setLogConsumers, setNetwork, setNetworkAliases, setNetworkMode, setPortBindings, setPrivilegedMode, setStartupAttempts, setStartupCheckStrategy, setVolumesFroms, setWaitStrategy, setWorkingDirectory, start, starting, stop, toString, waitingFor, withClasspathResourceMapping, withClasspathResourceMapping, withCommand, withCommand, withCreateContainerCmdModifier, withEnv, withEnv, withExposedPorts, withExtraHost, withFileSystemBind, withLogConsumer, withMinimumRunningDuration, withNetwork, withNetworkAliases, withNetworkMode, withPrivilegedMode, withStartupAttempts, withStartupCheckStrategy, withStartupTimeout, withVolumesFrom, withWorkingDirectory
apply, failed, succeeded
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getContainerName
addFileSystemBind, getFirstMappedPort, self
public JdbcDatabaseContainer(String dockerImageName)
protected abstract String getDriverClassName()
public abstract String getJdbcUrl()
public abstract String getUsername()
public abstract String getPassword()
protected abstract String getTestQueryString()
protected void waitUntilContainerStarted()
waitUntilContainerStarted
in class GenericContainer<SELF extends JdbcDatabaseContainer<SELF>>
public Driver getJdbcDriverInstance()
public Connection createConnection(String queryString) throws SQLException
queryString
- any special query string parameters that should be appended to the JDBC connection URL. The
'?' character must be includedSQLException
- if there is a repeated failure to create the connectionprotected void optionallyMapResourceParameterAsVolume(@NotNull String paramName, @NotNull String pathNameInContainer, @NotNull String defaultResource)
protected abstract Integer getLivenessCheckPort()
getLivenessCheckPort
in class GenericContainer<SELF extends JdbcDatabaseContainer<SELF>>
Copyright © 2017. All rights reserved.