pentaho/pentaho-kettle · error · KettleDatabaseException
Dynamic driver ' ' does not accept URL: — check the JDBC…
Error message
Dynamic driver '{effectiveClassName}' does not accept URL: {url} — check the JDBC URL format. What it means
After acceptsURL returned false (without throwing), PDI refuses to connect and throws this error telling the developer to check the JDBC URL format. It means the driver loaded fine but explicitly does not recognize the URL scheme/shape given.
Solutions
- Check that the URL's subprotocol matches the loaded driver (jdbc:<subprotocol>://...)
- Verify the DatabaseMeta database type / plugin corresponds to the URL you are using
- Compare against the vendor's documented URL format
- If multiple drivers are installed, ensure the correct one is resolved for this connection
Example fix
// before String url = "jdbc:mysql://host/db"; // loaded driver: postgresql // after String url = "jdbc:postgresql://host/db"; // matches loaded driver
Defensive patterns
Strategy: validation
Validate before calling
String sub = url.startsWith("jdbc:") && url.length() > 5 ? url.substring(5, url.indexOf(':', 5)) : null;
if (sub == null || !expectedSubprotocol.equals(sub)) throw new IllegalArgumentException("URL subprotocol '" + sub + "' does not match driver '" + expectedSubprotocol + "'"); Type guard
boolean urlMatchesDriver(String url, String subprotocol) { return url != null && url.startsWith("jdbc:" + subprotocol + ":"); } Try / catch
try { conn = db.getConnection(); } catch (KettleDatabaseException e) { if (e.getMessage().contains("does not accept URL")) { log.error("JDBC URL format mismatch for driver: " + e.getMessage()); } else throw e; } Prevention
- Match URL subprotocol to the selected database type/plugin
- Use vendor-documented URL templates
- Avoid copy-pasting URLs between different database types
- Check which dynamic driver got resolved for the connection
When it happens
Trigger: connectUsingClass -> openConnectionViaDynamicDriver: localDriver.acceptsURL(url) returns false — the URL prefix doesn't match the driver's expected jdbc:subprotocol format (e.g. passing a MySQL URL to a PostgreSQL driver).
Common situations: Copy-pasted URL from a different database type; missing subprotocol (jdbc://host instead of jdbc:postgresql://host); wrong database type selected in the connection dialog so the wrong driver class was loaded; typos in the subprotocol.
Understand the failure class
Background: "Invalid URL" errors: why new URL(), URI.parse, and reqwest::Url reject your string — missing scheme, whitespace, and bad path format — this error's family across 39 libraries.
Related errors
- Dynamic driver ' ' returned null for URL: — check that the…
- Dynamic driver ' ' threw exception checking URL
- Unable to construct a JDBC URL: at least the database name…
- Cannot fetch driver metadata for
- Dynamic driver ' ' failed to connect to URL
AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13).
Data as JSON: /api/errors/6e393f76efd2b988.
Report an issue: GitHub.
Appendix: source
Thrown at core/src/main/java/org/pentaho/di/core/database/Database.java:952
*/
private Connection openConnectionViaDynamicDriver( String effectiveClassName, String url, Properties properties )
throws KettleDatabaseException {
Driver localDriver = dynamicDriver.get();
if ( localDriver == null ) {
throw new KettleDatabaseException(
"Dynamic driver for '" + effectiveClassName + "' has been unloaded (disconnect was called concurrently). "
+ "Reconnect to reload the driver." );
}
boolean accepts;
try {
accepts = localDriver.acceptsURL( url );
} catch ( Exception e ) {
throw new KettleDatabaseException(
"Dynamic driver '" + effectiveClassName + "' threw exception checking URL '"
+ url + "': " + errorMsg( e ), e );
}
if ( !accepts ) {
throw new KettleDatabaseException(
"Dynamic driver '" + effectiveClassName + "' does not accept URL: " + url
+ " — check the JDBC URL format." );
}
try {
Connection c = localDriver.connect( url, properties );
if ( c == null ) {
throw new KettleDatabaseException(
"Dynamic driver '" + effectiveClassName + "' returned null for URL: " + url
+ " — check that the URL format and driver class are correct." );
}
return c;
} catch ( KettleDatabaseException e ) {
throw e;
} catch ( Exception e ) {
throw new KettleDatabaseException(
"Dynamic driver '" + effectiveClassName + "' failed to connect to URL '"
+ url + "': " + errorMsg( e ), e );
}View on GitHub (pinned to f3058517a1)