mysql - Access more than one db with ScalaAnorm with Play -


how access 2 separate mysql databases scalaanorm?

the documentation seems provide examples single db access.

you give second db name (instead of default) in application.conf it's own settings:

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= ... 

then can specify database want use so:

db.withconnnection("default") { implicit connection =>     // uses database named "default" }  db.withconnnection("anotherdb") { implicit connection =>     // uses database named "anotherdb" } 

Comments

Popular posts from this blog

javascript - how to protect a flash video from refresh? -

visual studio 2010 - Connect to informix database windows form application -

android - Associate same looper with different threads -