Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
677 views
in Technique[技术] by (71.8m points)

java - HikariCP Postgresql Driver Claims to not accept JDBC URL

I've pushed my application to cloudfoundry. However every time I connect to my postgresql/elephant sql I received this error

 Driver org.postgresql.Driver claims to not accept JDBC URL jdbc:postgres://cwkqmdql:[email protected]:5432/cwkqmdql/

Is there anything I've missed?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

There are a few issues with that URL and a latest PSQL driver may complain.

  1. jdbc:postgres: should be replaced with jdbc:postgresql:
  2. Do not use jdbc:postgresql://<username>:<passwor>..., user parameters instead: jdbc:postgresql://<host>:<port>/<dbname>?user=<username>&password=<password>
  3. In some cases you have to force SSL connection by adding sslmode=require parameter

So your URL should be:

jdbc:postgresql://@pellefant.db.elephantsql.com:5432/cwkqmdql?user=cwkqmdql&password=SsVqwdLxQObgaJAYu68O-8gTY1VmS9LX

or

jdbc:postgresql://@pellefant.db.elephantsql.com:5432/cwkqmdql?user=cwkqmdql&password=SsVqwdLxQObgaJAYu68O-8gTY1VmS9LX&sslmode=require

I hope that will help.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...