public abstract class JdbcDatabaseContainer extends GenericContainer implements LinkableContainer
| Modifier and Type | Field and Description |
|---|---|
protected Map<String,String> |
parameters |
containerId, containerName, dockerClient| 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) |
void |
setParameters(Map<String,String> parameters) |
protected void |
waitUntilContainerStarted() |
addEnv, addExposedPort, addExposedPorts, addFileSystemBind, addLink, canEqual, configure, containerIsStarted, containerIsStarting, createVolumeDirectory, equals, finished, getBinds, getCommandParts, getContainerId, getContainerInfo, getContainerName, getDockerClient, getDockerImageName, getEnv, getExposedPorts, getHostIpAddress, getIpAddress, getLinkedContainers, getMappedPort, hashCode, isRunning, logger, setBinds, setCommand, setCommand, setCommandParts, setContainerId, setContainerInfo, setContainerName, setDockerClient, setDockerImageName, setEnv, setExposedPorts, setLinkedContainers, start, starting, stop, toString, waitForListeningPort, withClasspathResourceMapping, withCommand, withCommand, withEnv, withExposedPortsapply, failed, succeededclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetContainerNamepublic 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 GenericContainerpublic 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 includedSQLExceptionprotected void optionallyMapResourceParameterAsVolume(String paramName, String pathNameInContainer)
protected abstract Integer getLivenessCheckPort()
getLivenessCheckPort in class GenericContainerCopyright © 2016. All rights reserved.