Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
This page describes authentication settings for Simba JDBC Driver (Legacy) versions 2.6.22 and below. These versions use the jdbc:spark:// URL scheme and the com.simba.spark.jdbc.Driver driver class.
- For Simba JDBC Driver (Legacy) versions 2.6.25 and above, which use the
jdbc:databricks://URL scheme and thecom.databricks.client.jdbc.Driverdriver class, see Authentication settings for the Simba JDBC Driver (Legacy) and Compute settings for the Simba JDBC Driver (Legacy). - For the Databricks JDBC Driver, version 3 and above, see Databricks JDBC Driver.
Warning
Use the most secure authentication flow available. The authentication methods on this page carry risks not present in other flows. Only use these methods when more secure options, such as managed identities, aren't viable.
Requirements
Driver versions 2.6.22 and below require the transportMode and SSL properties. Set these to http and 1, respectively. Current driver versions default transportMode to http and SSL to 1, so you don't need to set them.
For <server-hostname> and <http-path> values, see the procedures at the end of this page.
Personal access token authentication
Connection URL
jdbc:spark://<server-hostname>:443;httpPath=<http-path>;transportMode=http;SSL=1;UID=token;PWD=<personal-access-token>
Replace <personal-access-token> with your Azure Databricks personal access token.
Java
// ...
String url = "jdbc:spark://<server-hostname>:443;httpPath=<http-path>;transportMode=http;SSL=1";
Properties p = new java.util.Properties();
p.put("UID", "token");
p.put("PWD", "<personal-access-token>");
// ...
DriverManager.getConnection(url, p);
// ...
Microsoft Entra ID token authentication
Authenticate using a Microsoft Entra ID token.
Connection URL
jdbc:spark://<server-hostname>:443;httpPath=<http-path>;transportMode=http;SSL=1;AuthMech=11;Auth_Flow=0;Auth_AccessToken=<microsoft-entra-id-token>
Replace <microsoft-entra-id-token> with your Microsoft Entra ID token.
Java
String url = "jdbc:spark://<server-hostname>:443;httpPath=<http-path>;transportMode=http;SSL=1";
Properties p = new java.util.Properties();
p.put("AuthMech", "11");
p.put("Auth_Flow", "0");
p.put("Auth_AccessToken", "<microsoft-entra-id-token>");
// ...
DriverManager.getConnection(url, p);
// ...
To get the connection details for an Azure Databricks cluster:
- Log in to your Azure Databricks workspace.
- In the sidebar, click Compute.
- In the list of available clusters, click the target cluster's name.
- On the Configuration tab, expand Advanced options.
- Click the JDBC/ODBC tab.
- Copy the connection details that you need, such as Server Hostname, Port, and HTTP Path.
To get the connection details for a Databricks SQL warehouse, do the following:
- Log in to your Azure Databricks workspace.
- In the sidebar, under SQL, click SQL Warehouses.
- In the list of available warehouses, click the target warehouse's name.
- On the Connection details tab, copy the connection details that you need, such as Server hostname, Port, and HTTP path.
To use the driver with an Azure Databricks cluster, there are two permissions that the calling user or service principal needs when connecting to or restarting the cluster:
- CAN ATTACH TO permission to connect to the running cluster.
- CAN RESTART permission to automatically trigger the cluster to start if its state is terminated when connecting.
To use the driver with a Databricks SQL warehouse, the calling user or service principal needs CAN USE permission. The Databricks SQL warehouse automatically starts if it was stopped.
Note
Databricks SQL warehouses are recommended when using Microsoft Power BI in DirectQuery mode.