4

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!

1 Answer 1

10

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
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.