views:

544

answers:

1

I am wondering if there is a way to change the database at runtime in grails - e.g., in most commercial/opensource CMS, they allow the database server to be hosted elsewhere, and you can specify the address in some config screen at runtime.

since grails configs the database server using DataSource.groovy, how does one access the internals of this, and change the database url? or database type even?

+3  A: 

See Databases and Environments in the Grails documentation.

Also see Externalized Configuration if the above doesn't completely meet your needs.

Grails doesn't care where the DB resides as long as it is accessible via JDBC, so having the DB server elsewhere isn't a problem, just a configuration.

Ken Gentle
hhmm, thats pretty awesome - I didn't notice that part of the doco!
Chii