Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot connect to heroku postgres database using Netbeans

I am trying to connect to a database hosted in https://postgres.heroku.com/databases using Netbeans (build-in) Services/Databases. I am getting this error

Cannot establish a connection to jdbc:postgresql://ec2-xx-xxx-xxx-xxx.compute-1.am

I tried this with no issues: 1. Netbeans connecting to a local postgres database. 2. Using PgAdmin III connecting to heroku postgres databases.

I tried downloading the latest postgres driver and use it in netbeans to create connection but the same error.

Thanks in advance!

like image 649
kim Avatar asked Dec 26 '22 04:12

kim


1 Answers

When connecting outside of Heroku (e.g. locally), add this to the end of your JDBC connection URL:

?ssl=true&sslfactory=org.postgresql.ssl.NonValidatingFactory
like image 86
ryanbrainard Avatar answered Feb 01 '23 12:02

ryanbrainard