Is there a way to connect to azure databricks using JDBC

afraz
Giga Guru

Hi,

 

i am looking at a way to connect to Azure databricks using JDBC to pull data. Has anyone been able to successfully create a connection with databricks?

1 ACCEPTED SOLUTION

Okay so i was able to connect to databricks using JDBC. Below are the steps

 

1. Create a new JDBC data source for Databricks.

2. Create a new Format value for Databricks. Existing ones usually are MySQL/Oracle/SQL Server. Add one more for Databricks

3. In the value field for the new choice value add the below statement

  •         com.databricks.client.jdbc.Driver

4. bring the connection url field on the form of the Data source previously created and add the  JDBC connection url directly. you can get it from the databricks administrators. usually looks like below

  • databricks://xx.azuredatabricks.net:443/default;transportMode=http;ssl=1;httpPath=/sql/1.0/warehouses/xx;AuthMech=11;Auth_Flow=1;OAuth2ClientId=xx;OAuth2Secret=xx;

5. Download the Databricks JAR file from databricks website. the name is DatabricksJDBC42.jar

6. Upload this file to the MID Server from the JAR Files menu item under the MID Server

7. Restart the MID Server

8. Add your SQL statement to the data source previously created and test your data source.

View solution in original post

12 REPLIES 12

kmannem
Tera Contributor

Hi Afraz,

 

Thank you for the notes. I have set up the data source as mentioned above but ended up receiving the error as mentioned below while testing import. Any suggestions here or Am I missing anything, Any insights would be of great help.

 

Cannot invoke "java.util.Map.keySet()" because "this.fImportSourceFields" is null

 

Thanks,

Kushala

you'll have to try with different versions of the Databricks JAR file to see which one works. 

Vinay Kumar R
Tera Contributor

Thanks for the response and sharing steps. 

After completing above steps, I am getting error as below: 

 

Mid Server reported error: SQL State: null java.sql.SQLException:com.snc.automation_common.integration.exception.invalidConnectionParameterException: Unable to load JDBC driver: com.databricks.client.jdbc.Driver. 

 

 

Please check if your JAR file uploaded successfully in the extlib folder on the MID Server. Also the version this worked on was Xanadu. Not sure if it will run successfully on earlier versions.

vinaykumar61072
Tera Contributor

Thanks, Afraz. The solution worked. We replaced the Jar file with a lower version, and the connection was established with Data Bricks.