简体   繁体   中英

Where to put application.conf in Play for Scala standalone?

I am using Slick in Play for Scala standalone (ie not web application). Where to put the application.conf file so Slick takes the database configuration?

I tried in main/resources/application.conf but it doesn't work. This is my directories structure:

在此处输入图片说明

And this is the error I'm getting:

Exception in thread "main" com.typesafe.config.ConfigException$Missing: No configuration setting found for key 'dbControl'

And appplication.conf:

dbControl = {
  url = "jdbc:mysql://localhost:3306/control0001"
  driver = com.mysql.jdbc.Driver
  connectionPool = disabled
  keepAliveConnection = true
  user=root
  password=xxxx
}

这对我有用,将application.conf直接放在src / main / scala文件夹中。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM