{"record":{"id":"f21351a789ca3e5f","repo":"t8y2/dbx","slug":"jdbc-url-is-required","errorCode":null,"errorMessage":"JDBC URL is required.","messagePattern":"JDBC URL is required\\.","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"plugins/jdbc/src/main/java/app/dbx/jdbc/DbxJdbcPlugin.java","lineNumber":629,"sourceCode":"        for (Driver driver : ServiceLoader.load(Driver.class, loader)) {\n            Driver shim = new DriverShim(driver);\n            if (first == null) {\n                first = shim;\n            }\n            DriverManager.registerDriver(shim);\n            loaded = true;\n        }\n        if (!loaded && !urls.isEmpty()) {\n            throw new IllegalArgumentException(\"No JDBC driver was discovered. Enter the driver class name for this JAR.\");\n        }\n        registeredDriver = first;\n        registeredDriverKey = driverKey;\n    }\n\n    private static Connection openConnection(JsonNode connection) throws SQLException {\n        String url = jdbcUrl(connection);\n        if (url == null) {\n            throw new IllegalArgumentException(\"JDBC URL is required.\");\n        }\n        String key = connectionKey(connection);\n        if (sharedConnection != null && key.equals(sharedConnectionKey) && !isConnectionClosed(sharedConnection)) {\n            configureOrdinaryAutoCommit(sharedConnection);\n            return sharedConnection;\n        }\n        closeSharedConnection();\n\n        JdbcUrlCredentials urlCredentials = extractJdbcUrlCredentials(url);\n        url = urlCredentials.url;\n        Properties properties = new Properties();\n        applyPhoenixUrlProperties(url, properties);\n        String username = optionalText(connection, \"username\");\n        String password = optionalText(connection, \"password\");\n        if (username == null) {\n            username = urlCredentials.username;\n        }\n        if (password == null) {","sourceCodeStart":611,"sourceCodeEnd":647,"githubUrl":"https://github.com/t8y2/dbx/blob/c0390bff16418b651f4728520d99adf8ce48829a/plugins/jdbc/src/main/java/app/dbx/jdbc/DbxJdbcPlugin.java#L611-L647","documentation":"openConnection builds the effective JDBC URL from the connection JSON; when jdbcUrl() returns null (no url/jdbcUrl field and no derivable components), it throws this IllegalArgumentException before attempting any connection. The plugin requires an explicit or derivable JDBC URL to know which driver and database to target.","triggerScenarios":"Calling any operation that opens a connection (handle, conn, genericTableObjectSource) with a connection object that omits the url field, or supplies only partial fields (host/port without database, or a url key with null/empty value) that jdbcUrl() cannot assemble.","commonSituations":"Saving a connection profile without the URL, a config migration renaming the url key, template placeholders left unexpanded (e.g. ${DB_URL} resolving to null), or constructing the JSON connection node programmatically and forgetting the field.","solutions":["Add a valid JDBC URL to the connection config, e.g. \"url\": \"jdbc:postgresql://host:5432/mydb\".","If the plugin derives URLs from parts, fill in host, port, database (and vendor prefix option) so jdbcUrl() can construct the URL.","Check for typos in the connection key name (url vs jdbcUrl vs uri) against the plugin's expected field.","Log the parsed connection JSON before openConnection to confirm the field is present and non-empty at call time."],"exampleFix":"// before\n{ \"connection\": { \"host\": \"db.internal\", \"port\": 5432 } }\n// after\n{ \"connection\": { \"url\": \"jdbc:postgresql://db.internal:5432/appdb\" } }","handlingStrategy":"validation","validationCode":"// Java: validate connection config before calling the plugin\nstatic void requireUrl(java.util.Map<String,Object> conn) {\n    Object url = conn.get(\"url\");\n    if (url == null || url.toString().isBlank())\n        throw new IllegalArgumentException(\"connection.url is required (jdbc:vendor://host:port/db)\");\n    if (!url.toString().startsWith(\"jdbc:\"))\n        throw new IllegalArgumentException(\"connection.url must start with jdbc:\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Make url a required field in your connection profile schema","Validate that URLs start with jdbc: before saving them","Expand environment placeholders (${DB_URL}) and fail fast if unresolved","Reuse one tested connection-profile factory instead of hand-building JSON nodes"],"tags":["jdbc","configuration","validation"],"backgroundTag":"missing-connection-url","analyzedSha":"c0390bff16418b651f4728520d99adf8ce48829a","analyzedAt":"2026-09-05T23:05:10.900Z","contentChangedAt":"2026-09-05T23:05:10.900Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}