griffon插件的数据源配置是用DataSource.groovy编写的,我希望它在Config.properties中,是如何实现的?我试过了,没用的:
2. dataSource.driverClassName=com.mysql.jdbc.Driver dataSource.url=jdbc:mysql://localhost/smp?useUnicode=true&characterEncoding=UTF8中的Config.properties配置
3.从DataSource.groovy中删除此配置
似乎gsql插件必须从DataSource.groovy读取配置。
ps: gsql插件开源吗?
发布于 2011-03-29 03:34:32
受了伤。参考http://markmail.org/thread/gslnhxseaicc5ksp#query:+page:1+mid:beunoxesbbmlmznp+state:results
//read config.properties http://markmail.org/thread/gslnhxseaicc5ksp#query:+page:1+mid:beunoxesbbmlmznp+state:results
def props = new Properties()
props.load(getClass().classLoader.getResourceAsStream("Config.properties"))
def config = new ConfigSlurper().parse(props)
dataSource {
dbCreate = "skip"
pooled = config.dataSource.pooled as boolean
//set this to true if using MySQL or any other RDBMS that requires execution of DDL statements on separate calls
tokenizeddl = config.dataSource.tokenizeddl as boolean
driverClassName = config.dataSource.driverClassName
url = config.dataSource.url
username = config.dataSource.username
password = config.dataSource.password
}https://stackoverflow.com/questions/5453956
复制相似问题