microsoft / sql-spark-connector

Apache Spark Connector for SQL Server and Azure SQL
Apache License 2.0
273 stars 118 forks source link

java.sql.SQLException: No suitable driver #177

Closed krishnenduGupta closed 2 years ago

krishnenduGupta commented 2 years ago

Code which I have used

image

Packages installed on cluster.(All though I am not using AAD authentication) I created this cluster newly.

Databricks Runtime :9.1 LTS (includes Apache Spark 3.1.2, Scala 2.12)

! image

Added a init file at cluster level

dbutils.fs.put("/databricks/init/scripts/sqlremovejar.sh", """#!/bin/bash rm /databricks/jars/mssql """)

image

sumitppawar commented 2 years ago

@krishnenduGupta
Adding below option working for me

.option("driver", "com.microsoft.sqlserver.jdbc.SQLServerDriver") 
krishnenduGupta commented 2 years ago

@sumitppawar
Thanks the solution worked, but I had to add upload a jar file for jdbc connector.

Just one suggestion If these steps can be a part document then it would been very easy. Many Thanks

vlasvlasvlas commented 2 years ago

low

hi, this didnt work for me, do you need to change the imports or what libraries do you need installed?

vlasvlasvlas commented 2 years ago

orked, but I had to add upload a

what change you need to add? thanks

syedhassaanahmed commented 1 year ago

As @krishnenduGupta suggested, the .option("driver", "com.microsoft.sqlserver.jdbc.SQLServerDriver") part should be documented.