私の PC には PostgreSQL データベースがあります。Postgres サーバーはポート 5432 で実行されています。別の PC に移動して と入力するとtelnet server.ip 5432
、なんとか接続できました。ただし、Java を使用して接続しようとすると:
connection = DriverManager.getConnection("Jdbc:postgresql:mydb://server.ip:5432/", "user", "pass");
次のエラーが表示されます。Connection refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
何が問題なのか教えてもらえますか?
アップデート:
接続文字列を次のように変更しました。
connection = DriverManager.getConnection("jdbc:postgresql://server.ip:5432/mydb", "user", "pass");
そして今、私はエラーが発生していますFATAL: no pg_hba.conf entry for host "client.ip", user "user", database "mydb", SSL off