开发者

how to I can know the driver connection in a grails controller

I need know if my grails app is using the MySQL, PostgreSQL or Oracle connector, then in a Controller I need switching the cases depending of the connection that it has configured

def conn = <any class and method for kn开发者_开发百科ow the connection>
switch(conn){
   case 'my': .....
       breal
   case 'pg': .....
       breal
   case 'ora': .....
       breal
   default: .....
       breal
}

Please if you can help me... thanks for all!


def dbDriver = grailsApplication.config.dataSource.driverClassName
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜