title: Does the Postgresql JDBC Driver support Pgpass authentication?
body: <p>I am trying to connect to a Postgresql database from Java using the <a href="http://jdbc.postgresql.org/" rel="noreferrer">JDBC Driver</a> and would like to use <a href="http://www.postgresql.org/docs/9.3/static/libpq-pgpass.html" rel="noreferrer">pgpass</a> to authenticate.</p>
  
  <p>My Postgresql server is correctly setup for password authentication and I have a local <code>.pgpass</code> file; I can connect using <em>psql</em> without having to provide the user's password. However, when I try to open a connection in Java, I get the following error: </p>
  
  <pre><code>org.postgresql.util.PSQLException: The server requested password-based authentication, but no password was provided.
  </code></pre>
  
  <p>I am using the following code:</p>
  
  <pre><code>String url = "jdbc:postgresql://localhost/test";
  Properties props = new Properties();
  props.setProperty("user","my_user");
  Connection conn = DriverManager.getConnection(url, props);
  </code></pre>
  
  <p>My question is then: does the Postgres JDBC Driver support pgpass?</p>
  
  <p>The only clue I could find is in SO and seems to indicate that <a href="https://stackoverflow.com/a/5423832/191191">since the driver does not use libpq, then it cannot use pgpass</a>. I can't seem to find an authoritave answer anywhere though.</p>