Postgresql connection refused from java connection class
You are connecting using java via TCP/IP and using psql via named pipe. The database server uses pg_hba.conf configuration file for checking connections. This file, when changed, does not require the database to restart, but it should be notified for reloading it. In that file you need at least one line for psql executed locally, and one line for java connection. The line you showed starts wish host, so this is for TCP/IP connection. Before that, you might add a line for psql like local all all trust. The first all is the database name, the second one is the user name.

About the connection: your database is configured correctly, so maybe, your TCP connection is blocked by a firewall. Does you server really have that IP address, or is there any firewall that forward connection from that IP? In the former case, test your java connection from the server, in the latter check your firewall settings.