public class ContainerDatabaseDriver extends Object implements Driver
jdbc:tc:type://host:port/database?querystring
where type is a supported database type (e.g. mysql, postgresql, oracle). Behind the scenes a new
docker container will be launched running the required database engine. New JDBC connections will be created
using the database's standard driver implementation, connected to the container.
If TC_INITSCRIPT is set in querystring, it will be used as the path for an init script that
should be run to initialize the database after the container is created. This should be a classpath resource.
Similarly TC_INITFUNCTION may be a method reference for a function that can initialize the database.
Such a function must accept a javax.sql.Connection as its only parameter.
An example of a valid method reference would be com.myapp.SomeClass::initFunction| Constructor and Description |
|---|
ContainerDatabaseDriver() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
acceptsURL(String url) |
Connection |
connect(String url,
Properties info) |
int |
getMajorVersion() |
int |
getMinorVersion() |
Logger |
getParentLogger() |
DriverPropertyInfo[] |
getPropertyInfo(String url,
Properties info) |
boolean |
jdbcCompliant() |
public boolean acceptsURL(String url) throws SQLException
acceptsURL in interface DriverSQLExceptionpublic Connection connect(String url, Properties info) throws SQLException
connect in interface DriverSQLExceptionpublic DriverPropertyInfo[] getPropertyInfo(String url, Properties info) throws SQLException
getPropertyInfo in interface DriverSQLExceptionpublic int getMajorVersion()
getMajorVersion in interface Driverpublic int getMinorVersion()
getMinorVersion in interface Driverpublic boolean jdbcCompliant()
jdbcCompliant in interface Driverpublic Logger getParentLogger() throws SQLFeatureNotSupportedException
getParentLogger in interface DriverSQLFeatureNotSupportedExceptionCopyright © 2016. All rights reserved.