Вопрос

I'm trying to write an ANT script that connects to a remote (on Heroku) Postgres instance:

<sql driver="org.postgresql.Driver" url="${db.url}" userid="${db.username}" password="${db.password}" >
  <transaction  src="drop/tables_and_data.sql"/>
  ....
</sql>

The properties file that my ANT script uses looks like this:

db.url=jdbc:postgresql://<host>:<port>/<database>
db.username=<username>
db.password=<password>

I need to tell the driver to use SSL. SSL does not appear to be a property of the SQL target and google isn't helping me find a way to add it the URL.

Это было полезно?

Решение

Turns out it was a syntax issue. This is what I needed:

jdbc:postgresql://<host>:<port>/<database>?ssl=true&sslfactory=org.postgresql.ssl.NonValidatingFactory
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top