Documentation

You are viewing the documentation for the 2.4.0-RC3 development release. The latest stable release series is 2.8.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:[email protected]/database"

# To configure PostgreSQL
db.default.url="postgres://user:[email protected]/database"

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

# To configure MySQL running in Docker
db.default.url="mysql://user:[email protected]:port/database"

# To configure PostgreSQL running in Docker
db.default.url="postgres://user:[email protected]: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