Reputation: 649
I create a small app with mixed mode of h2. Database is local and allow remote connections at the same time. Remote connection are by tcp. To start tcp server I use this code:
public Server h2Server() throws SQLException {
return Server.createTcpServer("-tcp", "-tcpAllowOthers", "-tcpPort", "9092");
}
Problem is that app server listen only on tcp6 (IPv6).
How can I change settings that app will listen on tcp (IPv4)?
Upvotes: 0
Views: 315
Reputation: 2017
You can change it by starting java
, i.e your app, with -Djava.net.preferIPv4Stack=true
Upvotes: 1