DataSource.groovy
De Wiki Cursos IFPR Foz
dataSource {
pooled = true
driverClassName = "com.mysql.jdbc.Driver"
dialect = "org.hibernate.dialect.MySQL5InnoDBDialect"
}
hibernate {
cache.use_second_level_cache = true
cache.use_query_cache = true
cache.provider_class = 'net.sf.ehcache.hibernate.EhCacheProvider'
}
// environment specific settings
environments {
development {
dataSource {
dbCreate = "create-drop" // one of 'create', 'create-drop', 'update', 'validate', ''
url = "jdbc:mysql://localhost/locadoradb?createDatabaseIfNotExist=true"
username = "root"
password = "bancodedados"
}
}
test {
dataSource {
dbCreate = "update"
url = "jdbc:mysql://localhost/locadoradb?createDatabaseIfNotExist=true"
username = "root"
password = "bancodedados"
}
}
production {
dataSource {
dbCreate = "update"
url = "jdbc:mysql://localhost/locadoradb?createDatabaseIfNotExist=true"
username = "root"
password = "bancodedados"
}
}
}