Cannot connect to Postgresql DB in Play framework

后端 未结 1 604
太阳男子
太阳男子 2021-01-28 19:13

Im trying to connect to the Postgresql using play frame work. I tried Everything but I still cant solve this problem

db.default.user=user
db.default.password=qwe         


        
相关标签:
1条回答
  • 2021-01-28 20:00

    In file application.conf:

     db.default.driver=org.postgresql.Driver
     db.default.url="jdbc:postgresql://localhost:5432/dataBaseName"
     db.default.user=user
     db.default.password="password"
    

    create the path /lib in your main project (/) and should add the .jar do postgresql.

    Download here, and after reload the project.

    Or then add this code in build.sbt:

    libraryDependencies ++= Seq(
     "org.postgresql" % "postgresql" % "9.2-1003-jdbc4",
      javaJdbc,
      javaEbean,
      cache,
      javaWs
    )
    
    0 讨论(0)
提交回复
热议问题