This is the first time I have used java to access databases, so I probably have a simple error, but when I go on to restore my connection from a remote database that I have access to, I get a connection failure.
Here is the code in question:
String url = "jdbc:postgresql:url.isformatted.like.this/database";
try {
conn = DriverManager.getConnection(url, "username", "password");
} catch (SQLException e) {
e.printStackTrace();
System.exit(1);
}
(User url / password and database removed for privacy)
The problem cannot be the credentials or the URL itself, as I use it to automatically log in from the same field using psql. I think this is probably URL formatting, but I could not find examples of using psql on the remote address (they were all local hosts)