prestodb/presto · error · SQLException
Invalid JDBC URL:
Error message
Invalid JDBC URL:
What it means
parseDriverUrl strips the jdbc:presto: prefix and parses the remainder as a URI; a URISyntaxException (malformed URL, illegal characters) is converted to this SQLException carrying the offending URL, so the driver fails fast on unparseable connection strings.
Source
Thrown at presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoDriverUri.java:363
List<String> parts = ARG_SPLITTER.splitToList(queryArg);
if (result.put(parts.get(0), parts.get(1)) != null) {
throw new SQLException(format("Connection property '%s' is in URL multiple times", parts.get(0)));
}
}
}
return result;
}
private static URI parseDriverUrl(String url)
throws SQLException
{
URI uri;
try {
uri = new URI(url.substring(JDBC_URL_START.length()));
}
catch (URISyntaxException e) {
throw new SQLException("Invalid JDBC URL: " + url, e);
}
if (isNullOrEmpty(uri.getHost())) {
throw new SQLException("No host specified: " + url);
}
if (uri.getPort() == -1) {
throw new SQLException("No port number specified: " + url);
}
if ((uri.getPort() < 1) || (uri.getPort() > 65535)) {
throw new SQLException("Invalid port number: " + url);
}
return uri;
}
private URI buildHttpUri()
{
String scheme = useSecureConnection ? "https" : "http";
try {
return new URI(scheme, null, address.getHost(), address.getPort(), null, null, null);View on GitHub (pinned to 55bb57d202)
Solutions
- Fix the JDBC URL syntax, e.g. jdbc:presto://host:port/catalog/schema
- URL-encode illegal characters (spaces, unescaped delimiters) in the URL
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoDriverUri.java:363 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of prestodb/presto@55bb57d202 (2026-09-04).
Data as JSON: /api/errors/b162b77f6982815c.
Report an issue: GitHub.