Some implementation details causes an error like "Unable to complete network request to host "localhost""
To build "user_id" the following expression is used: "InetAddress.getLocalHost().getHostName()". This expression throws an exception if there is no appropriate information about local host name in /etc/hosts.
The problem is quite confusing because "isql" utility successfully connects to a database. In both cases (java and isql) the same connection string is used: "localhost:alias".
I think that the thrown exception can be ignored or more informative error message should be used.
The host name of my work station is "toronto". I am removing it from hosts and trying to connect via "localhost:alias". Then I am getting "Unable to complete network request to host "localhost"". Really the problem is "Unable to complete network request to host "toronto"". But why I need to describe "toronto" when I am using "localhost" or even explicit IP of the remote host.