Skip to content

Oracle-XE Module

See Database containers for documentation and usage that is common to all relational database container types.

Usage example

Running Oracle XE as a stand-in for in a test:

public class SomeTest {

    public OracleContainer oracle = new OracleContainer("name_of_your_oracle_xe_image");

    public void someTestMethod() {
        String url = oracle.getJdbcUrl();

        ... create a connection and run test as normal

Specifying a docker image name via config

If you do not pass an image name to the OracleContainer constructor, a suitable image name should be placed in configuration instead. To do this, please place a file on the classpath named, containing oracle.container.image=IMAGE, where IMAGE is a suitable image name and tag.

Adding this module to your project dependencies

Add the following dependency to your pom.xml/build.gradle file:

testCompile "org.testcontainers:oracle-xe:1.11.3"


Adding this Testcontainers library JAR will not automatically add a database driver JAR to your project. You should ensure that your project also has a suitable database driver as a dependency.