Forum Discussion
Databricks connect with Azure SQL Database
While following a Data Engineering hands-on tutorial on a YouTube channel, I ran into a JDBC connection failure in a Medallion architecture (Bronze to Silver pipeline).
Interestingly, my initial connection configuration code runs successfully, but the actual read operation using spark.read.jdbc throws an error. Both connections use the same personal account login.
Error: [FAILED_JDBC.CONNECTION] Failed JDBC jdbc:sqlserver:*********(redacted) on the operation: SQLSTATE: HV000
Why is spark.read.jdbc throwing a [FAILED_JDBC.CONNECTION] error with SQLSTATE: HV000 when the basic connection details are correct and working elsewhere? Any help to resolve this is greatly appreciated.
2 Replies
If the successful cell only assigns the connection string and properties, it has not tested a database connection. The failure during spark.read.jdbc is therefore consistent with configuration succeeding while the first real connection fails.
Start by expanding the exception to its underlying SQLServerException, including the SQL Server error number and message. HV000 alone does not establish an authentication mismatch.
Next, verify the JDBC driver version on the Databricks compute and use Microsoft's SQL Server JDBC driver for Azure SQL. Compare databaseName, server, and authentication properties with the working client. A personal account label does not specify whether SQL password or Microsoft Entra authentication is being used.
Test a minimal SELECT 1 query from that same compute, then check its network path and database permissions. Share the sanitized connection options, runtime version, and nested exception; those distinguish connection failure from table-access failure without guessing.
The error [FAILED_JDBC.CONNECTION] with SQLSTATE: HV000 in Databricks when using spark.read.jdbc usually indicates a driver-level or authentication mismatch rather than basic connection string issues. While your initial connection test succeeds, the Spark JDBC read path enforces stricter requirements (driver JAR availability, authentication method, and network reachability).
https://learn.microsoft.com/en-us/azure/databricks/connect/jdbc-connection