4

我正在尝试使用 Netbeans(内置)服务/数据库连接到托管在https://postgres.heroku.com/databases中的数据库。我收到此错误

无法建立与 jdbc 的连接:postgresql://ec2-xx-xxx-xxx-xxx.compute-1.am

我试过这个没有问题: 1. Netbeans 连接到本地 postgres 数据库。2. 使用 PgAdmin III 连接 heroku postgres 数据库。

我尝试下载最新的 postgres 驱动程序并在 netbeans 中使用它来创建连接,但同样的错误。

提前致谢!

4

1 回答 1

10

在 Heroku 外部(例如本地)连接时,将其添加到 JDBC 连接 URL 的末尾:

?ssl=true&sslfactory=org.postgresql.ssl.NonValidatingFactory
于 2013-06-12T06:45:59.620 回答