Question

Trouble with managed postgres JDBC connection.

I’m having trouble connecting to my managed postgres DB via jdbc.

  • I connect via PSQL and setup my db with no issues.
  • I’m connecting a fairly obscure database on top of it (datomic.com)
  • When I connect via the params below, I get a TIMEOUT.

protocol=sql
host=db-postgresql-nyc3-dbnum-do-user-accnum-0.b.db.ondigitalocean.com
port=25060
sql-url=jdbc:postgresql://db-postgresql-nyc3-dbnum-do-user-accnum-0.b.db.ondigitalocean.com/datomic
sql-user=u
sql-password=p
sql-driver-class=org.postgresql.Driver
sql-driver-params=ssl=true

I’m leaning towards it being something with ssl or jdbc, but I don’t know what. I’m currently not using any trusted sources or security of any type.


Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Bobby Iliev
Site Moderator
Site Moderator badge
June 21, 2023

Hi there,

As you are hitting a timeout error, this indicates that the problem might be related to the Postgres trusted sources. Where is the Datomic instance running on? You might have to add the IP address of the server where the Datomic instance is running on to your Postgres trusted sources list.

As a quick test, you could also extend the SSL parameter to:

sql-driver-params=ssl=true&sslfactory=org.postgresql.ssl.NonValidatingFactory

Let me know how it goes!

Best,

Bobby

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more
DigitalOcean Cloud Control Panel