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