Modifying a database at runtime with a Grails application

I am wondering if there is a way to change the database at runtime in grails - for example, in most commercial / openource CMS, they allow you to host the database server in another place, and you can specify the address on some configuration screen at runtime.

since grails configures the database server using DataSource.groovy, how do I access the internal data and change the database url? or database type even?

+3
source share
1 answer

See [Databases and Environments] ( http://grails.org/doc/1.0.x/guide/3.%20Configuration.html#3.3.1 Data Sources and Environments) in the Grails documentation.

. [ ] (http://grails.org/doc/1.0.x/guide/3.%20Configuration.html#3.4 ), .

Grails , , JDBC, , .

+4

Source: https://habr.com/ru/post/1699700/


All Articles