我正在尝试连接到 https://postgres.heroku.com/databases 中托管的数据库使用 Netbeans(内置)服务/数据库。我收到这个错误
无法建立与 jdbc 的连接:postgresql://ec2-xx-xxx-xxx-xxx.compute-1.am
我试过没有问题: 1.Netbeans 连接到本地 postgres 数据库。 2. 使用 PgAdmin III 连接到 heroku postgres 数据库。
我尝试下载最新的 postgres 驱动程序并在 netbeans 中使用它来创建连接,但出现同样的错误。
提前致谢!
最佳答案
在 Heroku 外部连接时(例如本地连接),将此添加到 JDBC 连接 URL 的末尾:
?ssl=true&sslfactory=org.postgresql.ssl.NonValidatingFactory
关于java - 无法使用 Netbeans 连接到 heroku postgres 数据库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16248882/