Documentation

You are viewing the documentation for the 2.4.0-RC3 development release. The latest stable release series is 3.0.x.

§Configuring the JDBC pool.

The Play JDBC datasource is managed by HikariCP.

§Special URLs

Play supports special url format for both MySQL and PostgreSQL:

# To configure MySQL
db.default.url="mysql://user:password@localhost/database"

# To configure PostgreSQL
db.default.url="postgres://user:password@localhost/database"

A non-standard port of the database service can be specified:

# To configure MySQL running in Docker
db.default.url="mysql://user:password@localhost:port/database"

# To configure PostgreSQL running in Docker
db.default.url="postgres://user:password@localhost:port/database"

§Reference

In addition to the classical driver, url, username, password configuration properties, it also supports additional tuning parameters if you need them. The play.db.prototype configuration from the Play JDBC reference.conf is used as the prototype for the configuration for all database connections. The defaults for all the available configuration options can be seen here:

Unable to find label in source file /confs/play-jdbc/reference.conf

Next: Configuring Play's thread pools