remove mysql warnnings

This commit is contained in:
wenshao
2013-05-09 12:43:40 +08:00
parent e4ba0b7a0d
commit f65754184d
@@ -91,6 +91,7 @@ public class DruidDataSource extends DruidAbstractDataSource implements DruidDat
private static final long serialVersionUID = 1L;
// stats
private final AtomicLong recycleErrorCount = new AtomicLong();
private long connectCount = 0L;
private long closeCount = 0L;
private final AtomicLong connectErrorCount = new AtomicLong();
@@ -265,6 +266,7 @@ public class DruidDataSource extends DruidAbstractDataSource implements DruidDat
preparedStatementCount.set(0);
transactionHistogram.reset();
cachedPreparedStatementDeleteCount.set(0);
recycleErrorCount.set(0);
}
public boolean isEnable() {
@@ -469,12 +471,6 @@ public class DruidDataSource extends DruidAbstractDataSource implements DruidDat
initExceptionSorter();
initValidConnectionChecker();
if (driver.getClass().getName().equals("com.mysql.jdbc.Driver")) {
if (this.isPoolPreparedStatements()) {
LOG.error("mysql should not use 'PoolPreparedStatements'");
}
}
if (useGloalDataSourceStat) {
dataSourceStat = JdbcDataSourceStat.getGlobal();
if (dataSourceStat == null) {
@@ -1042,8 +1038,13 @@ public class DruidDataSource extends DruidAbstractDataSource implements DruidDat
}
LOG.error("recyle error", e);
recycleErrorCount.incrementAndGet();
}
}
public long getRecycleErrorCount() {
return recycleErrorCount.get();
}
public void clearStatementCache() throws SQLException {
lock.lock();