Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Install postgresql with play! framework (Driver not found: [org.postgresql.Driver])

I'm new with the play! framework and postgresql and I'm trying to make it work.

I read a lot of questions asked on stackoverflow and I searched a lot on google but I didn't manage to make it work.

Here is the error that Play! gives me :

Driver not found: [org.postgresql.Driver] 

My questions are :

1) Do you know an easy tutorial (i.e. that explains from the beginning) that shows how to configure play! to make postgresql work? I read a lot of thing but didn't find a detailed tutorial.

2) If not, here is my configuration :

I added this in application.conf :

db.default.driver=org.postgresql.Driver
db.default.url="jdbc:postgresql://127.0.0.1/postgres"
db.default.user=postgres
db.default.password=root

And in built.sbt :

libraryDependencies ++= Seq(
  jdbc,
  anorm,
  cache,
)  

What am I doing wrong?

like image 569
Simon Avatar asked Jun 09 '14 16:06

Simon


1 Answers

As the documenation says, you have to add the driver to your dependencies:

libraryDependencies += "org.postgresql" % "postgresql" % "42.2.12"

Use the appropriate version of the driver for your Postgres installation.

http://www.playframework.com/documentation/2.3.x/ScalaDatabase

like image 81
Ryan Avatar answered Oct 15 '22 13:10

Ryan