title: PostgreSQL refusing connection
body: <p>I hava a PostgreSQL database on my PC. The Postgres server is running on port 5432. When I go on another PC and type in <code>telnet server.ip 5432</code>, I manage to connect. However when I try to connect using Java:</p>
  
  <pre><code>connection = DriverManager.getConnection("Jdbc:postgresql:mydb://server.ip:5432/", "user", "pass");
  </code></pre>
  
  <p>I get the following error: <code>Connection refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.</code> Can someone tell me what the problem might be?</p>
  
  <p><strong>UPDATE:</strong></p>
  
  <p>I changed the connection string to:</p>
  
  <pre><code>connection = DriverManager.getConnection("jdbc:postgresql://server.ip:5432/mydb", "user", "pass");
  </code></pre>
  
  <p>and now I am getting the error <code>FATAL: no pg_hba.conf entry for host "client.ip", user "user", database "mydb", SSL off</code></p>