cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
cancel
Showing results for 
Search instead for 
Did you mean: 

No suitable driver error When configure the Databricks ODBC and JDBC drivers

Anonymous
Not applicable

Hi all,

I've just encountered with this issue. Before I launched an My SQL database in RDS of AWS after use this simple code to create connection to it but it all fails with this error.

Is there any additional step? or could anyone can take a look on it!

Thank you very much!

Image 

Best Regard,

Jensen

1 ACCEPTED SOLUTION

Accepted Solutions

Pat
Honored Contributor III

Hi @Jensen Ackles​ ,

clearly you have put wrong jdbc connection. We can still see it in the logs.

Try something like this:

url="jdbc:mysql://some-instance.rds.amazonaws.com/<database_name>"

here is also example with driver option:

https://rajansahu713.medium.com/connecting-apache-spark-to-different-relational-databases-locally-an...

spark docs: https://spark.apache.org/docs/latest/sql-data-sources-jdbc.html

by the way, congratulations of achieving TOP 5 contributor in the databricks community in such a short time.

Thanks,

Pat.

View solution in original post

3 REPLIES 3

Pat
Honored Contributor III

Hi @Jensen Ackles​ ,

clearly you have put wrong jdbc connection. We can still see it in the logs.

Try something like this:

url="jdbc:mysql://some-instance.rds.amazonaws.com/<database_name>"

here is also example with driver option:

https://rajansahu713.medium.com/connecting-apache-spark-to-different-relational-databases-locally-an...

spark docs: https://spark.apache.org/docs/latest/sql-data-sources-jdbc.html

by the way, congratulations of achieving TOP 5 contributor in the databricks community in such a short time.

Thanks,

Pat.

Anonymous
Not applicable

@Pat Sienkiewicz​ thank you very much. I very happy to help people solve the problem also let them help me too. 😀

Jag
New Contributor II

Hello,

It looks issue with JDBC URL. When I am trying to access the Azure SQL database. I was facing the same issue. So I have created JDBC URL as below and it went well.

jdbc:sqlserver://<serverurl>:1433;database=<databasename>;user=<username>@<servername>;password=<password>;encrypt=true;trustServerCertificate=false;hostNameInCertificate=*.database.windows.net;loginTimeout=30;

db_user = "XXXXXXX"

db_password = "XXXXXXX"

db_jdbc_url = "jdbc:sqlserver://<serverurl>:1433;database=<databasename>;user=<db_user>@<servername>;password=<db_password>;encrypt=true;trustServerCertificate=false;hostNameInCertificate=*.database.windows.net;loginTimeout=30;"

def datahub_db_config(query):

  queryresult = (spark.read.format("jdbc")

         .option("url", db_jdbc_url)

         .option("query", query).

          option("user", db_user)

         .option("password",db_password).load()

         )

  return queryresult  

result = datahub_db_config(query="select * from <tablename>")

result = datahub_db_config(query=query)

Welcome to Databricks Community: Lets learn, network and celebrate together

Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections. 

Click here to register and join today! 

Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.