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

Need help to connect to local DB from Data bricks

Skesaram
New Contributor II

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.".

1 REPLY 1

Debayan
Esteemed Contributor III
Esteemed Contributor III

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.

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.