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: 

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
Databricks Employee
Databricks Employee

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.

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