0

I added HikariCP and Ebean to my Play Framework project.

When the project starts, Play reporting that connection pool is created:

[info] application - Creating Pool for datasource 'default'

How can I retrieve this pool/connections for my own modules?

Versions: Play 2.5 (java), built-in HikariCP, built-in ebean

Nikolay Matkheev
  • 375
  • 1
  • 2
  • 10
  • And can I have two pools for one db? – Nikolay Matkheev Dec 14 '16 at 09:17
  • Use injection. Just declare a parameter of type Database and then call getConnection() on it. Also, if you want to research this more independently, google for "Obtaining a JDBC connection" You should find this page: https://www.playframework.com/documentation/2.5.x/JavaDatabase – Jeutnarg Dec 19 '16 at 16:51

0 Answers0