bug fixed for dbType

This commit is contained in:
wenshao
2012-11-19 17:13:06 +08:00
parent f2833bc470
commit 04321df02c
2 changed files with 8 additions and 0 deletions
@@ -336,6 +336,10 @@ public class DruidDataSource extends DruidAbstractDataSource implements DruidDat
this.id = DruidDriver.createDataSourceId();
loadFilterFromSystemProperty();
if (this.dbType == null || this.dbType.length() == 0) {
this.dbType = JdbcUtils.getDbType(jdbcUrl, null);
}
for (Filter filter : filters) {
filter.init(this);
@@ -58,6 +58,10 @@ public class WallFilter extends FilterAdapter implements WallFilterMBean {
if (this.dbType == null || this.dbType.trim().length() == 0) {
this.dbType = dataSource.getDbType();
}
if (dbType == null) {
dbType = JdbcUtils.getDbType(dataSource.getUrl(), null);
}
if (JdbcUtils.MYSQL.equals(dbType)) {
if (config == null) {