簡體   English   中英

如何控制 Java 中 JDBC 連接的傳出 IP?

[英]How to control the outgoing IP of a JDBC connection in Java?

From the list of all available IP address of a Localhost, how to control or choose the IP in which the JDBC connection is made to the server, through java program?

我不認為這是可能的。

發送傳出網絡數據包時使用的接口 (NIC) 的選擇由路由配置決定,並操作系統中實現。 選擇的 NIC 將確定遠程服務器看到的“源”IP 地址。 AFAIK,普通用戶應用程序無法影響路由。 使用標准的 Java SE 庫肯定是不可能的。

Android 平台確實允許應用程序配置網絡路由,但我認為它不允許您在每個連接的基礎上執行此操作。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM