diff --git a/src/main/java/com/alibaba/druid/pool/DruidDataSource.java b/src/main/java/com/alibaba/druid/pool/DruidDataSource.java index 4656bfdde2..09dd927108 100644 --- a/src/main/java/com/alibaba/druid/pool/DruidDataSource.java +++ b/src/main/java/com/alibaba/druid/pool/DruidDataSource.java @@ -2414,7 +2414,7 @@ public class DruidDataSource extends DruidAbstractDataSource // 5 - 9 map.put("CloseCount", this.getCloseCount()); - map.put("ActiveCount", this.getActivePeak()); + map.put("ActiveCount", this.getActiveCount()); map.put("PoolingCount", this.getPoolingCount()); map.put("LockQueueLength", this.getLockQueueLength()); map.put("WaitThreadCount", this.getNotEmptyWaitThreadPeak()); diff --git a/src/main/java/com/alibaba/druid/sql/dialect/oracle/ast/stmt/OracleInsertStatement.java b/src/main/java/com/alibaba/druid/sql/dialect/oracle/ast/stmt/OracleInsertStatement.java index 5fecfdfc9f..547440814d 100644 --- a/src/main/java/com/alibaba/druid/sql/dialect/oracle/ast/stmt/OracleInsertStatement.java +++ b/src/main/java/com/alibaba/druid/sql/dialect/oracle/ast/stmt/OracleInsertStatement.java @@ -62,14 +62,18 @@ public class OracleInsertStatement extends SQLInsertStatement implements OracleS public void accept0(OracleASTVisitor visitor) { if (visitor.visit(this)) { - this.acceptChild(visitor, tableSource); - this.acceptChild(visitor, columns); - this.acceptChild(visitor, values); - this.acceptChild(visitor, query); + this.acceptChild(visitor, getTableSource()); + this.acceptChild(visitor, getColumns()); + this.acceptChild(visitor, getValues()); + this.acceptChild(visitor, getQuery()); this.acceptChild(visitor, returning); this.acceptChild(visitor, errorLogging); } visitor.endVisit(this); } + + public void output(StringBuffer buf) { + new OracleOutputVisitor(buf).visit(this); + } } diff --git a/src/main/java/com/alibaba/druid/support/logging/LogFactory.java b/src/main/java/com/alibaba/druid/support/logging/LogFactory.java index eb557cc99f..ad33649736 100644 --- a/src/main/java/com/alibaba/druid/support/logging/LogFactory.java +++ b/src/main/java/com/alibaba/druid/support/logging/LogFactory.java @@ -23,8 +23,21 @@ public class LogFactory { private static Constructor logConstructor; static { - // TODO add slf4j logging - + String logType= System.getProperty("druid.logType"); + if(logType != null){ + if(logType.equalsIgnoreCase("slf4j")){ + tryImplementation("org.slf4j.Logger", "com.alibaba.druid.support.logging.SLF4JImpl"); + }else if(logType.equalsIgnoreCase("log4j")){ + tryImplementation("org.apache.log4j.Logger", "com.alibaba.druid.support.logging.Log4jImpl"); + }else if(logType.equalsIgnoreCase("log4j2")){ + tryImplementation("org.apache.logging.log4j.Logger", "com.alibaba.druid.support.logging.Log4j2Impl"); + }else if(logType.equalsIgnoreCase("commonsLog")){ + tryImplementation("org.apache.commons.logging.LogFactory", + "com.alibaba.druid.support.logging.JakartaCommonsLoggingImpl"); + }else if(logType.equalsIgnoreCase("jdkLog")){ + tryImplementation("java.util.logging.Logger", "com.alibaba.druid.support.logging.Jdk14LoggingImpl"); + } + } // 优先选择log4j,而非Apache Common Logging. 因为后者无法设置真实Log调用者的信息 tryImplementation("org.apache.log4j.Logger", "com.alibaba.druid.support.logging.Log4jImpl"); tryImplementation("org.apache.logging.log4j.Logger", "com.alibaba.druid.support.logging.Log4j2Impl");