libraryDependencies ++= Seq(
"com.typesafe.slick" %% "slick" % "3.1.1",
"org.slf4j" % "slf4j-nop" % "1.6.4"
)
Then in my Application.Conf I put this
mydb = {
dataSourceClass = org.postgresql.ds.PGSimpleDataSource
properties = {
databaseName = "mydatabasename"
user = "postgres"
password = "mypassword"
}
numThreads = 10
}
Then finally in my controller I just have the connection string
package controllers
import javax.sql.DataSource
import org.mindrot.jbcrypt.BCrypt
import play.api._
import play.api.mvc._
import slick.driver.PostgresDriver.api._
import scala.concurrent.ExecutionContext.Implicits.global
class Application extends Controller {
val db = Database.forConfig("mydb")
try {
// ...
} finally db.close()
def index = Action {
Ok("My First Controller")
}
}
The error seems to be coming from val db = Database.forConfig("mydb")
As you can see I put the postgres driver instead of the H2 since I'm working with postgres and those credentials are the correct ones and verified.
databaseName = "mydatabasename"
user = "postgres"
password = "mypassword"