testcontainers/testcontainers-java · error · UnsupportedOperationException
The Oracle Database driver does not support this
Error message
The Oracle Database driver does not support this
What it means
OracleContainer.withUrlParam unconditionally throws UnsupportedOperationException. Oracle JDBC URLs (SID/service-name based) don't support the generic extra URL parameters that other Testcontainers RDBMS modules allow, so this API is intentionally not implemented for Oracle.
Solutions
- Remove the withUrlParam call
- Pass Oracle-specific options via withUrlParam alternatives: use JDBC connection properties on the DriverManager/DataSource instead (e.g. oracle.jdbc properties)
- Use withStartupTimeout / container config or a custom init script for behavior you were trying to toggle
Example fix
// before
container.withUrlParam("useSSL", "true");
// after
container.withUsername("app").withPassword("pw"); // configure via credentials/init scripts
Properties props = new Properties();
props.put("oracle.jdbc.ReadTimeout", "5000"); // set driver props on your DataSource instead Defensive patterns
Strategy: validation
Validate before calling
// never call withUrlParam on OracleContainer; configure driver props on your DataSource instead
Type guard
boolean supportsUrlParam(JdbcDatabaseContainer c) { return !(c instanceof OracleContainer); } Try / catch
try { container.withUrlParam(k, v); } catch (UnsupportedOperationException e) { /* apply driver property on DataSource instead */ } Prevention
- Check module-specific API docs before reusing config code across RDBMS modules
- Pass Oracle JDBC options via Properties on the DataSource/DriverManager
- Keep container builders per-database rather than generic shared code
When it happens
Trigger: Any call to oracleContainer.withUrlParam("sslmode", "require") or any other param name/value pair.
Common situations: Copy-pasting container setup code from PostgreSQL/MySQL modules that use withUrlParam; attempting to append JDBC options like connection properties to an Oracle container.
Understand the failure class
Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.
Related errors
- The ClickHouse does not support this
- getParentLogger not supported
- Username cannot be null or empty
- Setting a in not supported in the versions below 22.1.0
- Database name not supported
AI-assisted analysis of testcontainers/testcontainers-java@8e549514e3 (2026-09-12).
Data as JSON: /api/errors/92184ddc98445ed2.
Report an issue: GitHub.
Appendix: source
Thrown at modules/oracle-xe/src/main/java/org/testcontainers/containers/OracleContainer.java:190
throw new IllegalArgumentException("Database name cannot be null or empty");
}
if (DEFAULT_DATABASE_NAME.equals(databaseName.toLowerCase())) {
throw new IllegalArgumentException("Database name cannot be set to " + DEFAULT_DATABASE_NAME);
}
this.databaseName = databaseName;
return self();
}
public OracleContainer usingSid() {
this.usingSid = true;
return self();
}
@Override
public OracleContainer withUrlParam(String paramName, String paramValue) {
throw new UnsupportedOperationException("The Oracle Database driver does not support this");
}
@SuppressWarnings("SameReturnValue")
public String getSid() {
return DEFAULT_SID;
}
public Integer getOraclePort() {
return getMappedPort(ORACLE_PORT);
}
@SuppressWarnings("unused")
public Integer getWebPort() {
return getMappedPort(APEX_HTTP_PORT);
}
@Override
public String getTestQueryString() {View on GitHub (pinned to 8e549514e3)