Chris
Chris

Reputation: 547

Playframework 2.1.x Database Error

I try to add a database to my play framework app but I have several problems. I used the template (from Typesafe Activator) called "hello-play-2_3-scala". I always get an error if i try to insert 'import play.api.db._'. I looked at this instruction for the play database, but the main problem is I haven't any Build.scala file in my project folder. Also I cannot create once, just Java Files (I use Intellj Idea). I hope someone can help me.

Thanks!

Greetings Chryb.

Upvotes: 0

Views: 73

Answers (1)

Chiral Code
Chiral Code

Reputation: 1436

You should add jdbc dependency inside build.sbt file. It should look like this:

name := """hello-play-2_3-scala"""

version := "1.0-SNAPSHOT"

libraryDependencies ++= Seq(
  PlayKeys.jdbc,
  "org.webjars" %% "webjars-play" % "2.3-M1",
  "org.webjars" % "bootstrap" % "2.3.1",
  "org.webjars" % "requirejs" % "2.1.11-1"
)

lazy val root = (project in file(".")).addPlugins(PlayScala)

Upvotes: 1

Related Questions