【问题标题】:how to I can know the driver connection in a grails controller我如何知道 grails 控制器中的驱动程序连接
【发布时间】:2011-11-02 06:57:42
【问题描述】:

我需要知道我的 grails 应用程序是否使用 MySQL、PostgreSQL 或 Oracle 连接器,然后在控制器中我需要根据它已配置的连接切换情况

def conn = <any class and method for know the connection>
switch(conn){
   case 'my': .....
       breal
   case 'pg': .....
       breal
   case 'ora': .....
       breal
   default: .....
       breal
}

如果您能帮助我,请...谢谢大家!

【问题讨论】:

    标签: grails datasource connector


    【解决方案1】:
    def dbDriver = grailsApplication.config.dataSource.driverClassName
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-09-20
      相关资源
      最近更新 更多