boogie 发表于 2013-1-14 23:48:16

Property configuration of dataSource

def props = new Properties()InputStream is = new BufferedInputStream(new FileInputStream("${System.getenv("SITEHOME")}/config/cms.properties"))props.load(is)is.close()environments {    test {      dataSource {            dbCreate = "create" // one of 'create', 'create-drop','update'            driverClassName = "org.hsqldb.jdbcDriver"            url = "jdbc:hsqldb:mem:testDb"            username = "sa"            password = ""      }    }    development {      dataSource {            driverClassName = props.get("dataSourcedriverClassName")            url = props.get("dataSourceurl")            username = props.get("dataSourceusername")            password = props.get("dataSourcepassword")            dialect = org.hibernate.dialect.MySQL5InnoDBDialect      }    }    production {      dataSource {            driverClassName = props.get("dataSourcedriverClassName")            url = props.get("dataSourceurl")            username = props.get("dataSourceusername")            password = props.get("dataSourcepassword")            dialect = org.hibernate.dialect.MySQL5InnoDBDialect      }    }} 
http://www.nabble.com/Property-configuration-of-dataSource-connection-parameters-td18380697.html#a18380697
页: [1]
查看完整版本: Property configuration of dataSource