2014-09-10 3 views

답변

1

당신은 자신의 설정을 application.conf에 (대신 default의) 다른 이름 dB 두 번째 줄 것이다 :

db.default.driver=com.mysql.jdbc.Driver 
db.default.url= ... 
db.default.user= ... 
db.default.password= ... 

db.anotherdb.driver=com.mysql.jdbc.Driver 
db.anotherdb.url= ... 
db.anotherdb.user= ... 
db.anotherdb.password= ... 

그럼 당신은 당신과 같이 사용하고자하는 데이터베이스를 지정할 수 있습니다

DB.withConnnection("default") { implicit connection => 
    // uses the database named "default" 
} 

DB.withConnnection("anotherdb") { implicit connection => 
    // uses the database named "anotherdb" 
} 
관련 문제