this isn't compiled, but it has no dependencies to compile and only one to run
import java.sql.Connection
/** * Created by davec on 2014-03-28. */ class TestUrl { public static void main(String []args) { Connection con = java.sql.DriverManager.getConnection("jdbc:postgresql://yourhost","youruser","password"); con.createStatement().execute("select 1"); } }
psql always connects successfully no matter what. As for JDBC, we get the same results with or without ssl=true explicitly appended to the URL. What truly baffles me is that ye exact same java application works with no hiccups against a quasi-vanilla pgsql backend i’ve installed on windows 10. So far, the only visible difference I found is in the values for LC_COLLATE and LC_TYPE, which is V on the remote pgsql instances and English_United States.1252 on the local pgsql instance. Not sure how tis would affect accessing the DBs, though.
can you connect using psql on the windows system to the ubuntu hosted database?