kim
kim

Reputation: 41

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!

Upvotes: 4

Views: 1652

Answers (1)

ryanbrainard
ryanbrainard

Reputation: 6047

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

Upvotes: 10

Related Questions