t8y2/dbx · error · SQLException
JDBC driver rejected connect for URL '" + url + "'
Error message
JDBC driver rejected connect for URL '" + url + "'
What it means
The plugin first tries the explicitly registered driver's Driver.connect(url, properties). If that call fails with UnsupportedOperationException or AbstractMethodError — meaning the driver class is present but its connect() is not really implemented for this URL/protocol — the plugin wraps it in a SQLException with this message. This catches drivers that were registered but do not actually accept the given URL scheme.
Source
Thrown at plugins/jdbc/src/main/java/app/dbx/jdbc/DbxJdbcPlugin.java:678
}
// Prefer the explicitly registered driver. DriverManager.getConnection only catches
// SQLException; Hive/Inceptor drivers may throw UnsupportedOperationException for optional
// methods, which aborts connect before the intended driver is reached.
sharedConnection = connectWithRegisteredDriver(url, properties);
sharedConnectionKey = key;
configureOrdinaryAutoCommit(sharedConnection);
return sharedConnection;
}
private static Connection connectWithRegisteredDriver(String url, Properties properties) throws SQLException {
if (registeredDriver != null) {
try {
Connection connection = registeredDriver.connect(url, properties);
if (connection != null) {
return connection;
}
} catch (UnsupportedOperationException | AbstractMethodError error) {
throw new SQLException("JDBC driver rejected connect for URL '" + url + "'", error);
}
}
try {
return DriverManager.getConnection(url, properties);
} catch (UnsupportedOperationException | AbstractMethodError error) {
throw new SQLException("JDBC DriverManager rejected connect for URL '" + url + "'", error);
}
}
private static String describeThrowable(Throwable error) {
if (error == null) {
return "unknown error";
}
String message = error.getMessage();
if (message != null && !message.isBlank()
&& !message.equals(error.getClass().getName())
&& !message.equals(error.getClass().getSimpleName())) {
return error.getClass().getName() + ": " + message.trim();View on GitHub (pinned to c0390bff16)
Solutions
- Check that the JDBC URL scheme matches the registered driver (e.g. jdbc:postgresql:... with org.postgresql.Driver).
- Register/depend on the official, current driver JAR for the target database instead of a repackaged or partial jar.
- Update the driver to a recent release; AbstractMethodError indicates binary incompatibility between driver and JDK/JDBC API version.
- Note the plugin falls back to DriverManager.getConnection afterwards — check the follow-up error; if this one persists alone, the registered shim itself is broken, so fix driver discovery/registration.
Example fix
// before url = "jdbc:mysql://host:3306/db"; // but org.postgresql.Driver registered // after url = "jdbc:postgresql://host:5432/db"; // matches registered driver
Defensive patterns
Strategy: try-catch
Validate before calling
// Java: confirm driver accepts the URL scheme before connecting
static boolean driverAccepts(java.sql.Driver d, String url) throws SQLException {
try { return d.acceptsURL(url); } catch (Exception e) { return false; }
} Try / catch
try {
connection = plugin.open(connCfg);
} catch (java.sql.SQLException e) {
if (e.getMessage() != null && e.getMessage().startsWith("JDBC driver rejected connect")) {
throw new IllegalStateException("URL scheme does not match registered driver: " + e.getMessage(), e);
}
throw e;
} Prevention
- Match jdbc:<vendor> URL prefixes to the corresponding driver
- Use current official drivers to avoid AbstractMethodError from old builds
- Call acceptsURL() yourself as a pre-flight check
- Keep one driver per database vendor on the classpath
When it happens
Trigger: Calling openConnection (via handle/conn/genericTableObjectSource) where registeredDriver.connect() throws UnsupportedOperationException or AbstractMethodError — typically a stub driver, a driver whose class was force-registered from a JAR scan but whose URL scheme (jdbc:xyz:) doesn't match, or an ancient/partial driver implementation.
Common situations: Registering a generic JAR whose discovered class isn't the real Driver, mixing driver versions (old driver jar that lacks connect logic for new URL formats), or dialect mismatch like using a MySQL URL against a registered PostgreSQL driver shim.
Related errors
- Not a wrapper for <iface name>
- Connection failed
- H2 JDBC driver rejected URL: " + buildJdbcUrl(params)
- Informix connection failed.\nURL: " + url.replaceAll("//[^@]
- JDBC pool registry must be attached before connecting
AI-assisted analysis of t8y2/dbx@c0390bff16 (2026-09-05).
Data as JSON: /api/errors/16a5231a3620a663.
Report an issue: GitHub.