I'm connecting to Intersystems Cache database using Intersystems JDBC Driver. There are several network interfaces on client host. I need to make all the Cache traffic to go through a particular interface.
Is there a way to choose which network interface to use for Cache connection via JDBC Driver API or somehow via Java code? The approach to use ip route add
is suitable but I'm looking for a Java-way like setLocalAddress()
on some APIs or something.
Asked
Active
Viewed 68 times
1

sys463
- 337
- 2
- 5
- 18
-
Unlikely, because Java itself doesn't offer you a way to control this. It relies on the lower level routing provided by the OS, except maybe if the JDBC driver provides a way to specify a custom socket factory so you can specify the local address. – Mark Rotteveel Aug 18 '21 at 13:06
-
Hi @MarkRotteveel! Thanks for your comment. Yep, that's what I was worried about - I didn't find anything straightforward in api :( – sys463 Aug 23 '21 at 13:02