【发布时间】:2012-02-25 20:51:46
【问题描述】:
我正在尝试与另一台服务器上的另一个数据库建立第二个数据库连接。我们正在使用播放框架 1.2.4,我找到了 1.2.3 的以下文档。
http://www.playframework.org/documentation/1.2.3/model#multiple
application.conf:
db_other.url=jdbc:mysql://localhost/test
db_other.driver=com.mysql.jdbc.Driver
db_other.user=root
db_other.pass=
Connection conn = DB.getDBConfig("other").getConnection()
这对我不起作用,所以我进行了更多搜索并找到了以下文章。 这篇文章告诉我,上面的配置是从1.3的master分支泄露进来的,以后会有用...
JPA.getJPAConfig method not found on Play's API
https://play.lighthouseapp.com/projects/57987/tickets/706
谁能给我一种方法来对其他数据库进行一些简单的查询?我想我不是唯一一个想要使用多个数据库的人。
谢谢!
【问题讨论】:
-
使用此列表查询同一服务器上的另一个数据库 test = JPA.em().createNativeQuery("SELECT * FROM other_db..TABLE").getResultList();在sybase中
标签: playframework multiple-databases