Quantcast
Channel: Commentaires sur : Grails Tips : externaliser la configuration
Viewing all articles
Browse latest Browse all 4

Par : Aurélien Maury

$
0
0

Yes, it is actually straightforward, JNDI datasource are supported out of the box by Grails. But let’s write it down. In your project you can set your grails-app/conf/DataSource.groovy like this :

environments {
    development {
        dataSource { ... }
    }
    test {
        dataSource { ... }
    }
    production {
        dataSource { 
           jndiName = "java:comp/env/myDataSource"
        }
    }
}

And create a « myDataSource » resource in the Tomcat context of your application. (look here for more on Resources : http://goo.gl/ps9ot)


Viewing all articles
Browse latest Browse all 4