sql-server - JDBC 连接失败
问题描述
我正在尝试通过 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
也许这是问题,但我不知道如何解决它。
解决方案
因为您可以从 squirrel 成功连接到 Azure SQL;Azure 端的情况很好。
一个问题可能是 SSL;但很可能不是因为它在没有 SSL 的情况下重试也失败了。
在胶水端;请查看该端口是否允许出站连接。
推荐阅读
- hyperlink - 使用 mapbox 在弹出窗口中添加链接
- css - 是否可以让 flex div 坐在有空间的地方?
- database - HBase 在大 o-notation 中通过 rowkey 获取行的性能
- c# - 修复 .NET Core App 3.1 开源依赖项漏洞
- unreal-engine4 - UE4 复杂碰撞,物理材质覆盖不起作用
- windows - 我需要使用哪个 Gitlab 运行器?
- graphhopper - 如何在 Ubuntu 上设置本地 Graphhoper 服务器
- php - CakePHP 4 - 对于表 A 中的 2 个外键,从表 B 中获取对应数据
- javascript - 使用 shp2stl 的类型错误
- c# - 在 MVC 应用程序中过滤转换为日期 SQL 查询的日期(字符串)