Multiple Databases with Play Framework 2.1.x

后端 未结 3 472
面向向阳花
面向向阳花 2020-12-28 08:52

I have 2 databases that I need to connect to. I can easily connect to them in the application.conf file like so:

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


        
3条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-28 09:23

    I had the same problem and I fixed it by specifying the server name at the Model.Finder level.

    So in your case, in your User class, you should have something like :

    public static Model.Finder find = new Finder("secondary", Long.class, User.class);
    

提交回复
热议问题