cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
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 III

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)

โ€œEmpower Minds, Share Wisdom - Together We Grow!โ€

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you wonโ€™t want to miss the chance to attend and share knowledge.

If there isnโ€™t a group near you, start one and help create a community that brings people together.

Request a New Group