public abstract class JdbcDatabaseContainer<SELF extends JdbcDatabaseContainer<SELF>> extends GenericContainer<SELF> implements LinkableContainer
GenericContainer.AbstractWaitStrategyContainer.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.
|
String |
getDatabaseName() |
protected abstract String |
getDriverClassName() |
Driver |
getJdbcDriverInstance()
Obtain an instance of the correct JDBC driver for this particular database container type
|
abstract String |
getJdbcUrl() |
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() |
SELF |
withDatabaseName(String dbName) |
SELF |
withPassword(String password) |
SELF |
withUsername(String username) |
addEnv, addExposedPort, addExposedPorts, addFileSystemBind, addFixedExposedPort, addLink, canEqual, close, configure, containerIsStarted, containerIsStarting, copyFileFromContainer, copyFileToContainer, createVolumeDirectory, equals, execInContainer, execInContainer, fetchDockerDaemonInfo, finished, followOutput, followOutput, getBinds, getCommandParts, getContainerId, getContainerInfo, getContainerIpAddress, getContainerName, getCreateContainerCmdModifiers, getDockerClient, getDockerDaemonInfo, getDockerImageName, getEnv, getEnvMap, getExposedPorts, getExtraHosts, getImage, getIpAddress, getLinkedContainers, getLivenessCheckPort, getLivenessCheckPorts, 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, withWorkingDirectoryapply, failed, succeededclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetContainerNameaddFileSystemBind, getFirstMappedPort, self, withEnv, withFileSystemBindpublic JdbcDatabaseContainer(String dockerImageName)
protected abstract String getDriverClassName()
public abstract String getJdbcUrl()
public String getDatabaseName()
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)
Copyright © 2018. All rights reserved.