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
精彩评论