Skip to content Skip to sidebar Skip to footer

How To Use Mysql And Mssql Together In The Grails Datasource?

I have an grails application that uses MySQL for authentication purpose and another application that uses MSSQL for database stuff. I need to combine these together as one applicat

Solution 1:

If you follow the link provided earlier, then you would end up with a datasource configuration like below:

environments {
    production {
        dataSource_authentication {
            pooled = true
            url = "jdbc:mysql://yourServer/yourDB"
            driverClassName = "com.mysql.jdbc.Driver"
            username = "yourUser"
            password = "yourPassword"
            ........
        }
        dataSource {
            pooled = true
            driverClassName = "com.microsoft.sqlserver.jdbc.SQLServerDriver" 
            dialect = "org.hibernate.dialect.SQLServer2008Dialect"
            ........
        }
    }
}

Where ever required you can use the authentication datasource explicitly.

Post a Comment for "How To Use Mysql And Mssql Together In The Grails Datasource?"