简体   繁体   中英

PlayFramework SQL Database error

Am trying to use access SQL DataBase with Play Framework, my application.conf contains :

   db.default.driver=com.microsoft.sqlserver.jdbc.SQLServerDriver
   db.default.url="jdbc:jtds:sqlserver://server_ip:1433/db-name"
   db.default.user="user"
   db.default.password="password"

and i have the jtds jar file in the lib folder with the play dependencies add to my Build.sbt file

and i still got the following error: Cannot connect to database [default].

can anyone help.

If you are tracking the tutorial project, you can see you have to give your database name in your application.conf file as:

db=postgres://user:pwd@host/database

In the past I got over the problem doing:

db=postgres://humungus:humungus@localhost/yourdatabasename

It worked for me.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM