引用 http://java.dzone.com/news/database-connection-pooling
dataSource {
configClass = GrailsAnnotationConfiguration.class
pooled = true
driverClassName = "com.mysql.jdbc.Driver"
//driverClassName = "com.p6spy.engine.spy.P6SpyDriver" // use this driver to enable p6spy logging
username = "root"
password = ""
dialect = "org.hibernate.dialect.MySQL5InnoDBDialect"
properties {
minEvictableIdleTimeMillis=1800000
timeBetweenEvictionRunsMillis=1800000
numTestsPerEvictionRun=3
testOnBorrow=true
testWhileIdle=true
testOnReturn=true
validationQuery="SELECT 1"
}
}
本文介绍了一种使用Grails框架进行数据库连接池配置的方法。配置中指定了使用MySQL数据库,定义了连接池属性,如最小空闲时间、检查间隔等,并设置了验证查询。
460

被折叠的 条评论
为什么被折叠?



