{"record":{"id":"c1cca4ca412bd0ce","repo":"testcontainers/testcontainers-java","slug":"database-name-not-supported","errorCode":null,"errorMessage":"Database name {} not supported","messagePattern":"Database name (.+?) not supported","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"modules/jdbc/src/main/java/org/testcontainers/jdbc/ContainerDatabaseDriver.java","lineNumber":115,"sourceCode":"                LOGGER.debug(\"Container not found in cache, creating new instance\");\n\n                Map<String, String> parameters = connectionUrl.getContainerParameters();\n\n                /*\n                  Find a matching container type using ServiceLoader.\n                 */\n                ServiceLoader<JdbcDatabaseContainerProvider> databaseContainers = ServiceLoader.load(\n                    JdbcDatabaseContainerProvider.class\n                );\n                for (JdbcDatabaseContainerProvider candidateContainerType : databaseContainers) {\n                    if (candidateContainerType.supports(connectionUrl.getDatabaseType())) {\n                        container = candidateContainerType.newInstance(connectionUrl);\n                        container.withTmpFs(connectionUrl.getTmpfsOptions());\n                        delegate = container.getJdbcDriverInstance();\n                    }\n                }\n                if (container == null) {\n                    throw new UnsupportedOperationException(\n                        \"Database name \" + connectionUrl.getDatabaseType() + \" not supported\"\n                    );\n                }\n\n                /*\n                  Cache the container before starting to prevent race conditions when a connection\n                  pool is started up\n                 */\n                jdbcUrlContainerCache.put(url, container);\n\n                /*\n                  Pass possible container-specific parameters\n                 */\n                container.setParameters(parameters);\n\n                /*\n                  Start the container\n                 */","sourceCodeStart":97,"sourceCodeEnd":133,"githubUrl":"https://github.com/testcontainers/testcontainers-java/blob/8e549514e3f01c57d70546fbb8599d138f3903e5/modules/jdbc/src/main/java/org/testcontainers/jdbc/ContainerDatabaseDriver.java#L97-L133","documentation":"Testcontainers' JDBC proxy driver (jdbc:tc:// URLs) throws this UnsupportedOperationException when no registered JdbcDatabaseContainerProvider supports the database type given in the URL (the part after jdbc:tc:). It means the JDBC URL names a database for which no container provider module is on the classpath or the type string is misspelled.","triggerScenarios":"Calling DriverManager.getConnection with a jdbc:tc://<dbtype>://... URL where <dbtype> does not match any provider's supports() check — e.g. a typo like 'postgresl', or using a type whose container module (e.g. testcontainers postgresql/mssql/oracle modules) is not a Maven dependency.","commonSituations":"Forgot to add the testcontainers database-module dependency for that DB; typo'd the database type in the JDBC URL; upgraded testcontainers and the module split; copying a URL from a different project.","solutions":["Fix the database type in the jdbc:tc URL (check spelling, e.g. jdbc:tc:postgresql://... not jdbc:tc:postgres://...)","Add the corresponding testcontainers database module dependency, e.g. org.testcontainers:postgresql","Verify the provider is registered via ServiceLoader (dependency actually resolved in the test classpath, not just provided scope)","If a real driver URL was intended, remove the jdbc:tc: prefix and use the vendor driver directly"],"exampleFix":"// before\nString url = \"jdbc:tc:postgres:16:///mydb\";\n// after\nString url = \"jdbc:tc:postgresql:16:///mydb\"; // plus dependency org.testcontainers:postgresql","handlingStrategy":"validation","validationCode":"String dbType = url.startsWith(\"jdbc:tc:\") ? url.substring(\"jdbc:tc:\".length()).split(\":\")[0] : null;\nSet<String> known = Set.of(\"postgresql\",\"mysql\",\"mariadb\",\"mssqlserver\",\"oracle\",\"db2\",\"clickhouse\",\"neo4j\");\nif (dbType == null || !known.contains(dbType)) throw new IllegalArgumentException(\"Unsupported jdbc:tc database type: \" + dbType);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep the testcontainers module for your DB as a test dependency","Copy jdbc:tc URLs from the module's documentation, not from memory","Assert provider availability early in test setup"],"tags":["jdbc","testcontainers","unsupported-database","classpath"],"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"}