{"record":{"id":"92184ddc98445ed2","repo":"testcontainers/testcontainers-java","slug":"the-oracle-database-driver-does-not-support-this-92184d","errorCode":null,"errorMessage":"The Oracle Database driver does not support this","messagePattern":"The Oracle Database driver does not support this","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"modules/oracle-xe/src/main/java/org/testcontainers/containers/OracleContainer.java","lineNumber":190,"sourceCode":"            throw new IllegalArgumentException(\"Database name cannot be null or empty\");\n        }\n\n        if (DEFAULT_DATABASE_NAME.equals(databaseName.toLowerCase())) {\n            throw new IllegalArgumentException(\"Database name cannot be set to \" + DEFAULT_DATABASE_NAME);\n        }\n\n        this.databaseName = databaseName;\n        return self();\n    }\n\n    public OracleContainer usingSid() {\n        this.usingSid = true;\n        return self();\n    }\n\n    @Override\n    public OracleContainer withUrlParam(String paramName, String paramValue) {\n        throw new UnsupportedOperationException(\"The Oracle Database driver does not support this\");\n    }\n\n    @SuppressWarnings(\"SameReturnValue\")\n    public String getSid() {\n        return DEFAULT_SID;\n    }\n\n    public Integer getOraclePort() {\n        return getMappedPort(ORACLE_PORT);\n    }\n\n    @SuppressWarnings(\"unused\")\n    public Integer getWebPort() {\n        return getMappedPort(APEX_HTTP_PORT);\n    }\n\n    @Override\n    public String getTestQueryString() {","sourceCodeStart":172,"sourceCodeEnd":208,"githubUrl":"https://github.com/testcontainers/testcontainers-java/blob/8e549514e3f01c57d70546fbb8599d138f3903e5/modules/oracle-xe/src/main/java/org/testcontainers/containers/OracleContainer.java#L172-L208","documentation":"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.","triggerScenarios":"Any call to oracleContainer.withUrlParam(\"sslmode\", \"require\") or any other param name/value pair.","commonSituations":"Copy-pasting container setup code from PostgreSQL/MySQL modules that use withUrlParam; attempting to append JDBC options like connection properties to an Oracle container.","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"],"exampleFix":"// before\ncontainer.withUrlParam(\"useSSL\", \"true\");\n// after\ncontainer.withUsername(\"app\").withPassword(\"pw\"); // configure via credentials/init scripts\nProperties props = new Properties();\nprops.put(\"oracle.jdbc.ReadTimeout\", \"5000\"); // set driver props on your DataSource instead","handlingStrategy":"validation","validationCode":"// never call withUrlParam on OracleContainer; configure driver props on your DataSource instead","typeGuard":"boolean supportsUrlParam(JdbcDatabaseContainer c) { return !(c instanceof OracleContainer); }","tryCatchPattern":"try { container.withUrlParam(k, v); } catch (UnsupportedOperationException e) { /* apply driver property on DataSource instead */ }","preventionTips":["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"],"tags":["oracle","testcontainers","unsupported-operation","jdbc"],"backgroundTag":"unsupported-operation","analyzedSha":"8e549514e3f01c57d70546fbb8599d138f3903e5","analyzedAt":"2026-09-12T14:56:41.227Z","contentChangedAt":"2026-09-12T14:56:41.227Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}