Hi @nikita_w ,
Short answer: no, the Databricks JDBC driver does not require spaces in the URL. Your URL is syntactically valid.
The official format is:
jdbc:databricks://<server-hostname>:<port>;[property1]=[value];[property2]=[value];...
Semicolons are the delimiter. Property names are case-insensitive. No spaces needed, and none of the official examples rely on them.
The duplicate key message ("Multiple entries with same key: authmech=3 and authmech=3") is the real clue here. That error pattern is characteristic of code that builds a map of key-value pairs and rejects duplicates (think Guava ImmutableMap.Builder). It means the properties are being parsed and applied twice.
This almost certainly lives in whatever client tool or framework you're using to test the connection, not in the Databricks JDBC driver itself. Here's the typical sequence:
- You pass a full JDBC URL string with properties embedded (AuthMech, transportMode, etc.).
- Your client tool parses the URL and extracts those recognized properties into its own Properties object.
- The tool passes both the raw URL string and the extracted Properties object to the driver.
- The driver parses the properties from the URL string again.
- When the two sets merge, each property appears twice, and the duplicate key check fails.
That also explains why "adding a space" appears to fix it. The space likely breaks your client tool's URL parser just enough that it stops extracting those properties on its own, leaving only the driver to handle them. No more duplicates, connection works. It's a workaround, not a real fix.
To actually resolve this, a few options:
Split the URL and properties (recommended approach per the docs):
String url = "jdbc:databricks://example-databricks.cloud:443";
Properties p = new Properties();
p.put("httpPath", "/sql/1.0/warehouses/warehouse123");
p.put("AuthMech", "3");
p.put("transportMode", "http");
Connection conn = DriverManager.getConnection(url, p);
If you prefer embedding everything in the URL, check whether your client tool is also setting the same keys in a separate properties or advanced settings pane. Remove the duplicates from one place or the other.
If you can capture a full stack trace, that will tell you definitively whether the exception originates in the Databricks driver JAR or in your client library.
Bottom line: the URL you showed is valid, the driver does not require spaces, and the duplicate key error is coming from whatever layer is constructing or normalizing the connection properties before they reach the driver. Fix it there.
Cheers, Lou