source: trunk/grails-app/conf/DataSource.groovy @ 928

Last change on this file since 928 was 923, checked in by gav, 14 years ago

Externalise the config.

File size: 2.0 KB
Line 
1dataSource {
2    // Open separate connections to database for every request or pool connections.
3    pooled = true
4}
5hibernate {
6    cache.use_second_level_cache=true
7    cache.use_query_cache=true
8    cache.provider_class='net.sf.ehcache.hibernate.EhCacheProvider'
9}
10
11// dbCreate options.
12// create-drop: Drop and re-create the database tables on restart. Deletes existing data.
13// create:       Create the database if it doesn't exist, but don't modify it if it does. Deletes existing data.
14// update:     Create the database if it doesn't exist, and modify it if it does exist. Keep data.
15// If nothing specified then do nothing to database schema.
16
17// Environment specific settings.
18// All production config is in external config.
19environments {
20    development {
21        dataSource {
22            /** HSQLDB - In memory */
23            driverClassName = "org.hsqldb.jdbcDriver"
24            username = "sa"
25            password = ""
26            dbCreate = "create-drop"
27            url = "jdbc:hsqldb:mem:devDb"
28            /** MySQL */
29//             dialect = org.hibernate.dialect.MySQL5InnoDBDialect
30//             driverClassName = "com.mysql.jdbc.Driver"
31//             username = "gnumimsadmin"
32//             password = "gnumimsadmin"
33//             dbCreate = "create-drop"
34//             url = "jdbc:mysql://host:3306/gnumims_dev?autoReconnect=true&sessionVariables=storage_engine=InnoDB"
35        }
36    }
37    test {
38        dataSource {
39            /** HSQLDB - In memory */
40            driverClassName = "org.hsqldb.jdbcDriver"
41            username = "sa"
42            password = ""
43            dbCreate = "update"
44            url = "jdbc:hsqldb:mem:devDb"
45            /** MySQL */
46//             dialect = org.hibernate.dialect.MySQL5InnoDBDialect
47//             driverClassName = "com.mysql.jdbc.Driver"
48//             username = "gnumimsadmin"
49//             password = "gnumimsadmin"
50//             dbCreate = "update"
51//             url = "jdbc:mysql://host:3306/gnumims_test?autoReconnect=true&sessionVariables=storage_engine=InnoDB"
52        }
53    }
54}
Note: See TracBrowser for help on using the repository browser.