I’ve been having a heck of a time getting my Play! framework java app to run on Heroku, and I think I’ve narrowed it down to the Postgres JDBC driver not liking Heroku’s DATABASE_URL parameter because it starts with postgres: and not postgresql:.
What is the proper way to configure a play! 2.0 app to connect to a heroku-provided Postgres instance?
I’ve tried variations on the following:
PLAY_OPTS=”-Ddb.default.url=$DATABASE_URL -Ddb.default.driver=org.postgresql.Driver”
But upon startup I get a SQLException that no suitable driver can be found for $DATABASE_URL.
No need to pass them in as system properties you can pickup Heroku environment variables in your
application.conffileThen define this in your
ProcfileIt should pick up the
DATABASE_URLproperty for the Heroku environment. Although, I recommend creating a configuration file that is specific for the Heroku environment (i.e. heroku-prod.conf), but this is just an example.