2011-08-23 6 views
0

Grails 앱이 MySQL, PostgreSQL 또는 Oracle 커넥터를 사용하고 컨트롤러에서 구성한 연결에 따라 케이스를 전환해야하는 경우 알아야합니다.grails 컨트롤러에서 드라이버 연결을 알 수있는 방법

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

저를 도울 수 있으면 제발 ... 모두를위한 감사합니다!

답변

0
def dbDriver = grailsApplication.config.dataSource.driverClassName 
관련 문제