This is my first time using java to access databases, so I probably have a simple mistake here, but when I go to retrieve my connection from a remote database I have access to, I get a connection refused.
Here's 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/pass and database url removed for privacy sake)
The problem couldn't be credentials or the URL itself, as I use it to manually log in from the same box successfully using psql. I'm thinking it's probably the formatting of the URL, but I couldn't find any examples of psql being used on a remote address (they were all local host kinda things)