griffon gsql plugin的datasource配置是用DataSource.groovy编写的, 我希望它在Config.properties中,怎么样? 我试试,它不起作用:
2.config: dataSource.driverClassName = com.mysql.jdbc.Driver ?dataSource.url = JDBC:MySQL的://本地主机/ SMP了useUnicode =真安培;的characterEncoding = UTF8
3.从DataSource.groovy
中删除此配置似乎gsql插件必须从DataSource.groovy读取配置。
ps:是gsql插件opensource吗?
答案 0 :(得分:1)
sloved。 参考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
}