Why Playframework database configuration error in

2019-09-20 18:33发布

问题:

I have have correct PostgreSQL installed and I can use this by other framework such as Spring. When I tried write some code for Play 2.1 that should use postgresql 9.4.1. I'm also using Slick 3.0.

I have following in the application.conf

db.default.driver="org.postgresql.Driver"


db.default.url="jdbc:postgresql:mydb"


db.default.user=myuser


db.default.password=mypass

When I start application it give error:-

Missing configuration [db.ansiDump.driver]

I added

db.ansiDump.driver="org.postgresql.Driver"

db.ansiDump.url="jdbc:postgresql:mydb"

Then I get error:-

Missing configuration [db.unicodeDump.driver]

I added

db.unicodeDump.driver="org.postgresql.Driver"


db.unicodeDump.url="jdbc:postgresql:mydb"


Then I get error:-

Missing configuration [db.dumpPaths.driver]

So again I added:-

db.dumpPaths.driver="org.postgresql.Driver"


db.dumpPaths.url="jdbc:postgresql:mydb"


After all these sequence of driver and url, It worked. I am sure, I am doing something wrong to configure drive o url.

Please tell me what is wrong and how it should be done.

Updated infromation:-

Additional information.

Sorry I can't keep correct format for the whole application.conf file content. So I uploaded it in Google Drive. Please check the link enter link description here

To reproduce the error I had to comment line number 45 #db.ansiDump.driver="org.postgresql.Driver"

After comment I get this exception:-

Configuration error Missing configuration [db.ansiDump.driver] In /Users/ma/work/app/conf/application.conf:45

回答1:

I think the url should be

db.default.url="jdbc:postgresql://localhost:5432/dbName"