我正在尝试通过JDBC将AWS Glue连接到Azure SQL Server。我尝试了jdbc url的不同设置,但没有成功。该URL的外观如下:
jdbc:sqlserver://domain.windows.net:1433/database
jdbc:sqlserver://domain.windows.net:1433;databaseName=database
在AWS文档中,SQL Server语法为jdbc:sqlserver://host:port;databaseName=db_name
出于测试目的,我使用了Squirrel SQL并与它成功建立了到Azure SQL Server的连接。
当我尝试在AWS Glue中建立测试连接时,AWS CloudWatch给出了以下日志:
Attempting to connect with SSL: jdbc:sqlserver://domain.windows.net:1433;database={database}
SSL connection to data store failed. Retrying without SSL.
Check that your connection definition references your JDBC database with correct URL syntax, username, and password. The TCP/IP connection to the host domain.windows.net, port 1433 has failed. Error: "Connection timed out: no further information. 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.".
对我来说,奇怪的是连接中的'{'括号。 Azure的连接字符串告诉我,连接本身应如下所示:
jdbc:sqlserver://domain.windows.net:1433;database=database
也许是问题所在,但我不确定如何解决。