public class DruidDriver extends Object implements Driver, DruidDriverMBean
| 限定符和类型 | 字段和说明 |
|---|---|
private String |
acceptPrefix |
private AtomicLong |
connectCount |
private static AtomicInteger |
dataSourceIdSeed |
static String |
DEFAULT_PREFIX |
static String |
DRIVER_PREFIX |
static String |
FILTERS_PREFIX |
private static DruidDriver |
instance |
static String |
JMX_PREFIX |
private static Log |
LOG |
private int |
majorVersion |
private static String |
MBEAN_NAME |
private int |
minorVersion |
static String |
NAME_PREFIX |
static String |
PASSWORD_CALLBACK_PREFIX |
private static ConcurrentMap<String,DataSourceProxyImpl> |
proxyDataSources |
private static AtomicInteger |
sqlStatIdSeed |
| 构造器和说明 |
|---|
DruidDriver() |
| 限定符和类型 | 方法和说明 |
|---|---|
boolean |
acceptsURL(String url) |
Connection |
connect(String url,
Properties info) |
static int |
createDataSourceId() |
Driver |
createDriver(String className) |
static int |
createSqlStatId() |
String |
getAcceptPrefix() |
long |
getConnectCount() |
private DataSourceProxyImpl |
getDataSource(String url,
Properties info)
参数定义: com.alibaba.druid.log.LogFilter=filter com.alibaba.druid.log.LogFilter.p1=prop-value
com.alibaba.druid.log.LogFilter.p2=prop-value
|
String[] |
getDataSourceUrls() |
String |
getDruidVersion() |
static DruidDriver |
getInstance() |
int |
getMajorVersion() |
int |
getMinorVersion() |
Logger |
getParentLogger() |
DriverPropertyInfo[] |
getPropertyInfo(String url,
Properties info) |
static ConcurrentMap<String,DataSourceProxyImpl> |
getProxyDataSources() |
boolean |
jdbcCompliant() |
static DataSourceProxyConfig |
parseConfig(String url,
Properties info) |
static boolean |
registerDriver(Driver driver) |
void |
resetStat() |
private static Log LOG
private static final DruidDriver instance
private static final ConcurrentMap<String,DataSourceProxyImpl> proxyDataSources
private static final AtomicInteger dataSourceIdSeed
private static final AtomicInteger sqlStatIdSeed
private final AtomicLong connectCount
private String acceptPrefix
private int majorVersion
private int minorVersion
public static boolean registerDriver(Driver driver)
public static DruidDriver getInstance()
public static int createDataSourceId()
public static int createSqlStatId()
public boolean acceptsURL(String url) throws SQLException
acceptsURL 在接口中 DriverSQLExceptionpublic Connection connect(String url, Properties info) throws SQLException
connect 在接口中 DriverSQLExceptionprivate DataSourceProxyImpl getDataSource(String url, Properties info) throws SQLException
url - SQLExceptionpublic static DataSourceProxyConfig parseConfig(String url, Properties info) throws SQLException
SQLExceptionpublic Driver createDriver(String className) throws SQLException
SQLExceptionpublic int getMajorVersion()
getMajorVersion 在接口中 DruidDriverMBeangetMajorVersion 在接口中 Driverpublic int getMinorVersion()
getMinorVersion 在接口中 DruidDriverMBeangetMinorVersion 在接口中 Driverpublic DriverPropertyInfo[] getPropertyInfo(String url, Properties info) throws SQLException
getPropertyInfo 在接口中 DriverSQLExceptionpublic boolean jdbcCompliant()
jdbcCompliant 在接口中 DruidDriverMBeanjdbcCompliant 在接口中 Driverpublic long getConnectCount()
getConnectCount 在接口中 DruidDriverMBeanpublic String getAcceptPrefix()
getAcceptPrefix 在接口中 DruidDriverMBeanpublic String[] getDataSourceUrls()
getDataSourceUrls 在接口中 DruidDriverMBeanpublic static ConcurrentMap<String,DataSourceProxyImpl> getProxyDataSources()
public Logger getParentLogger() throws SQLFeatureNotSupportedException
getParentLogger 在接口中 DriverSQLFeatureNotSupportedExceptionpublic void resetStat()
resetStat 在接口中 DruidDriverMBeanpublic String getDruidVersion()
getDruidVersion 在接口中 DruidDriverMBeanCopyright © 2013–2019 Alibaba Group. All rights reserved.