0

我需要知道我的 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
}

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

4

1 回答 1

0
def dbDriver = grailsApplication.config.dataSource.driverClassName
于 2011-08-23T21:39:20.023 回答