Need help to connect to local DB from Data bricks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2023 06:44 AM
jdbcHostname="478"
jdbcPort=1433
jdbcDatabase="Onprem_AzureDB"
jdbcUsername="upendra"
jdbcPassword="upendrakumar"
jdbcDriver="com.microsoft.sqlserver.jdbc.SQLServerDriver"
jdbcUrl=f"jdbc:sqlserver://{jdbcHostname}:{jdbcPort};databaseName={jdbcDatabase};user={jdbcUsername};password={jdbcPassword}"
test1=spark.read.format("jdbc").option("url",jdbcUrl).option("dbtable","onprem_table1").load()
display(test1)
Error:
com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host 478, port 1433 has failed. Error: "478. Verify the connection properties. Make sure that an instance of SQL Server is running on the host and accepting TCP/IP connections at the port. Make sure that TCP connections to the port are not blocked by a firewall.".
- Labels:
-
Data
-
databricks
-
Jdbc
-
Sqlserver
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2023 11:05 PM
Hi, Could you please verify the network connectivity from Databricks to the SQL server? Please make sure SQL:port is allowed in your firewall rules or security groups.