title: How to do I deploy a Spring app using Postgresql to Heroku using Spring Boot?
body: <p>I am evaluating Spring 4 on Heroku and I am so far very impressed with both.</p>
  
  <p>However, I am having trouble getting my Spring Boot app to run on Heroku.  Everything is working fine, except Postgresql (I just get <code>Connection Refused</code> errors).  </p>
  
  <p>The problem will surely be to do with how I am setting up the <code>DataSource</code> but so far I've just been following a trial and error approach! I am not exactly sure how I am supposed to set-up the data source from the Heroku <code>DATABASE_URL</code> and I can't find any examples.  </p>
  
  <p>I have found <a href="https://github.com/spring-projects/spring-cloud" rel="noreferrer">spring-cloud</a> by chance by searching on Google which looks promising but it doesn't explained anything about the <code>DATABASE_URL</code>.  Also, it isn't even mentioned on Spring.IO so I am wondering if it is even an option for production use?</p>