你如何访问Grails中的两个数据库 [英] How do you access two databases in Grails

查看:82
本文介绍了你如何访问Grails中的两个数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Grails使得在其DataSources.groovy文件中为不同环境(开发,测试,制作)配置数据源变得非常简单,但似乎没有在一个环境中配置多个数据源的功能。如果我需要从同一Grails应用程序访问多个数据库,该怎么做?

解决方案

现在有了Grails插件,它使直接在Grails的GORM层使用多个数据源:
http://burtbeckwith.com/blog /?p = 70


Grails makes it very easy to configure datasources for different environments (development, test, production) in its DataSources.groovy file, but there seems to be no facility for configuring multiple datasources in one environment. What to I do if I need to access several databases from the same Grails application?

解决方案

There is now Grails plugin that enables the use of multiple datasources directly with Grails' GORM layer: http://burtbeckwith.com/blog/?p=70

这篇关于你如何访问Grails中的两个数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆