How to setup Spring/Heroku/postgres SSL datasource

前端 未结 4 1826
孤独总比滥情好
孤独总比滥情好 2020-12-25 08:16

I\'m trying to create a datasource from my Heroku/Spring application to postgres.heroku.com postgres database. Here is my applicationContext.xml snippet.

<
4条回答
  •  没有蜡笔的小新
    2020-12-25 08:46

    It worked for me:

      
            
            
            
            
        
    

    The mistake I was doing was using an & instead of & (silly I know)

     ?ssl=true&sslfactory=org.postgresql.ssl.NonValidatingFactory
    

    and yes the link definitely is helpful: https://devcenter.heroku.com/articles/connecting-to-relational-databases-on-heroku-with-java#connecting-to-a-database-remotely

    AND Keep in mind: in this link, jdbc:postgres://host.. is used, which might not be suitable for you (use postgresql instead) if No suitable Sql driver error occurs

提交回复
热议问题