{"record":{"id":"4972550eb4c12d8a","repo":"apache/seatunnel","slug":"failed-connecting-to-the-configured-jdbc-url-via-j","errorCode":null,"errorMessage":"Failed connecting to the configured JDBC URL via JDBC.","messagePattern":"Failed connecting to the configured JDBC URL via JDBC\\.","errorType":"exception","errorClass":"CatalogException","httpStatus":null,"severity":"critical","filePath":"seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/catalog/AbstractJdbcCatalog.java","lineNumber":155,"sourceCode":"                        try {\n                            Connection connection = driver.connect(url, info);\n                            connectionMap.put(url, connection);\n                            return connection;\n                        } catch (Exception e) {\n                            log.info(\"try connector failed\", e);\n                        }\n                    }\n                }\n            } catch (Exception e) {\n                log.info(\"find driver error, back to DriverManager.getConnection\", e);\n            }\n        }\n        try {\n            Connection connection = DriverManager.getConnection(url, info);\n            connectionMap.put(url, connection);\n            return connection;\n        } catch (SQLException e) {\n            throw new CatalogException(\"Failed connecting to the configured JDBC URL via JDBC.\", e);\n        }\n    }\n\n    protected @NonNull Properties getConnectionProperties() {\n        Properties info = new Properties();\n        if (username != null) {\n            info.put(\"user\", username);\n        }\n        if (pwd != null) {\n            info.put(\"password\", pwd);\n        }\n        return info;\n    }\n\n    @Override\n    public void open() throws CatalogException {\n        getConnection(defaultUrl);\n        LOG.info(\"Catalog {} established connection to {}\", catalogName, defaultUrl);","sourceCodeStart":137,"sourceCodeEnd":173,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/catalog/AbstractJdbcCatalog.java#L137-L173","documentation":"AbstractJdbcCatalog.getConnection() could not establish a JDBC connection to the configured URL via DriverManager, and wraps the SQLException in CatalogException. This is a generic 'cannot connect to the database' error raised when opening connections for catalog metadata operations.","triggerScenarios":"DriverManager.getConnection(url, info) throws SQLException inside getConnection(); called by open(), conn(), queryString(), querySQLResultExists(), executeInternal(), defaultConnection() during catalog metadata access.","commonSituations":"Wrong host/port in JDBC URL; database server down; missing JDBC driver on the classpath (no suitable driver); bad credentials; network/firewall/TLS issues; URL malformed for the specific dialect.","solutions":["Test the same JDBC URL/username/password with a standalone JDBC client from the SeaTunnel node.","Verify the JDBC driver jar is present (driver class registered) for the target database.","Check network reachability: host, port, firewall, VPC rules.","Validate the JDBC URL format and parameters for the dialect.","Check DB server logs and auth (user exists, correct password, allowed hosts)."],"exampleFix":"// before\nurl = \"jdbc:mysql://localhst:3306/db\"\n// after\nurl = \"jdbc:mysql://localhost:3306/db?useSSL=false\"","handlingStrategy":"try-catch","validationCode":"try (Connection c = DriverManager.getConnection(url, user, pass)) { /* ok */ } catch (SQLException e) { /* fail fast pre-job with clear message */ }","typeGuard":null,"tryCatchPattern":"catch (CatalogException e) { if (e.getCause() instanceof SQLException sqlEx) { log.error(\"JDBC connect failed: state={} msg={}\", sqlEx.getSQLState(), sqlEx.getMessage()); } }","preventionTips":["Validate JDBC URL, credentials, and driver availability before job start","Check network/firewall reachability from SeaTunnel nodes","Include the correct JDBC driver jar in the plugin directory","Match URL parameters to the target dialect"],"tags":["jdbc","catalog","connection","drivermanager"],"backgroundTag":"connection-refused","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}