mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
C3P0兼容
git-svn-id: http://code.alibabatech.com/svn/druid/trunk@659 b9813039-fb51-4c41-a8b9-e21c2acb5095
This commit is contained in:
@@ -6,7 +6,7 @@ import java.sql.SQLException;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
|
||||
public class DruidC3P0WrapDataSource implements DataSource {
|
||||
public class DruidC3P0WrapDataSource implements DataSource, DruidC3P0WrapDataSourceMBean {
|
||||
|
||||
private DruidDataSource dataSource;
|
||||
|
||||
@@ -159,6 +159,28 @@ public class DruidC3P0WrapDataSource implements DataSource {
|
||||
dataSource.setValidationQuery(preferredTestQuery);
|
||||
}
|
||||
|
||||
// /////////////////
|
||||
|
||||
@Override
|
||||
public boolean isEnable() {
|
||||
return dataSource.isEnable();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void shrink() {
|
||||
dataSource.shrink();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getWaitThreadCount() {
|
||||
return dataSource.getWaitThreadCount();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getLockQueueLength() {
|
||||
return dataSource.getLockQueueLength();
|
||||
}
|
||||
|
||||
// ///////////////
|
||||
|
||||
private int maxStatementsPerConnection;
|
||||
@@ -353,6 +375,4 @@ public class DruidC3P0WrapDataSource implements DataSource {
|
||||
this.breakAfterAcquireFailure = breakAfterAcquireFailure;
|
||||
}
|
||||
|
||||
// ////////////////
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.alibaba.druid.pool;
|
||||
|
||||
public interface DruidC3P0WrapDataSourceMBean {
|
||||
|
||||
String getUser();
|
||||
|
||||
int getCheckoutTimeout();
|
||||
|
||||
boolean isAutoCommitOnClose();
|
||||
|
||||
int getIdleConnectionTestPeriod();
|
||||
|
||||
int getInitialPoolSize();
|
||||
|
||||
int getMaxIdleTime();
|
||||
|
||||
int getMaxPoolSize();
|
||||
|
||||
int getMinPoolSize();
|
||||
|
||||
boolean isTestConnectionOnCheckout();
|
||||
|
||||
boolean isTestConnectionOnCheckin();
|
||||
|
||||
String getPreferredTestQuery();
|
||||
|
||||
// //////////
|
||||
|
||||
boolean isEnable();
|
||||
|
||||
void shrink();
|
||||
|
||||
String toString();
|
||||
|
||||
int getWaitThreadCount();
|
||||
|
||||
int getLockQueueLength();
|
||||
}
|
||||
Reference in New Issue
Block a user