开发者

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

开发者 https://www.devze.com 2023-03-30 19:25 出处:网络
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

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

精彩评论

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