Chinaunix首页 | 论坛 | 博客
  • 博客访问: 863962
  • 博文数量: 215
  • 博客积分: 10062
  • 博客等级: 上将
  • 技术积分: 2235
  • 用 户 组: 普通用户
  • 注册时间: 2007-12-01 13:21
文章分类

全部博文(215)

文章存档

2012年(1)

2011年(24)

2009年(16)

2008年(91)

2007年(83)

我的朋友

分类:

2008-05-19 16:54:19

只需要修改DataSource.groovy就可以了:
 eg:
  dataSource {
 pooled = false
// driverClassName = "org.hsqldb.jdbcDriver"
 driverClassName = "com.mysql.jdbc.Driver" 
 username = "root"
 password = "root"
}
hibernate {
    cache.use_second_level_cache=true
    cache.use_query_cache=true
    cache.provider_class='org.hibernate.cache.EhCacheProvider'
}
// environment specific settings
environments {
 development {
  dataSource {
   dbCreate = "update" // one of 'create', 'create-drop','update'
//   url = "jdbc:hsqldb:mem:devDB"
     url = "jdbc:mysql://localhost/jp_ad_sys?useUnicode=true&characterEncoding=UTF8"
  }
 }
 test {
  dataSource {
   dbCreate = "update"
    url = "jdbc:mysql://localhost/jp_ad_sys?useUnicode=true&characterEncoding=UTF8"
  }
 }
 production {
  dataSource {
   dbCreate = "update"
    url = "jdbc:mysql://localhost/jp_ad_sys?useUnicode=true&characterEncoding=UTF8"
  }
 }
}
PS:
  注意了Grails会自己创建数据表的,dbCreate那个值非常的重要
阅读(1994) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~