JDBC 某些 WiFi 无法连接到 Azure 服务器:允许所有 IP

JDBC can't connect to azure server for some WiFis: All IPs permitted

我想从 Android 连接到我的 Azure 数据库。来自 Android 边 im 使用 JDBC:

Connection con = ConnectionJDBC.connectionClass();
String query = "SELECT * FROM mytable";
Statement stmt = con.createStatement();
stmt.executeUpdate(query);

从 Azure 方面来看,我的服务器正常启动并且 运行 并且防火墙设置允许 IP 0.0.0.0 到 255.255.255.255。其他一切不变。

这也适用于我提出请求的大多数 WiFi 网络。但是,它不适用于我大学的 WiFi(特别是 ETH Zurich),con 将为空。有人知道问题出在哪里吗?我认为它在于 Azure 服务器的配置,但我不知道我还能更改什么。

请看JDBC vs Web Service for Android, as suggested by Morrison Chang: JDBC should not be used and is sometimes blocked. Instead create a mobile app service in Azure (they will change the name to web app service), and connect to that server, as suggested here: https://docs.microsoft.com/en-us/azure/app-service-mobile/app-service-mobile-android-get-started