com.alibaba.druid.proxy
Class DruidDriver

java.lang.Object
  extended by com.alibaba.druid.proxy.DruidDriver
All Implemented Interfaces:
DruidDriverMBean, Driver

public class DruidDriver
extends Object
implements Driver, DruidDriverMBean

Author:
wenshao

Field Summary
static String DEFAULT_PREFIX
           
static String DRIVER_PREFIX
           
static String FILTERS_PREFIX
           
static String JMX_PREFIX
           
static String NAME_PREFIX
           
static String PASSWORD_CALLBACK_PREFIX
           
 
Constructor Summary
DruidDriver()
           
 
Method Summary
 boolean acceptsURL(String url)
           
 Connection connect(String url, Properties info)
           
static int createDataSourceId()
           
 Driver createDriver(String className)
           
static int createSqlStatId()
           
 String getAcceptPrefix()
           
 long getConnectCount()
           
 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()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_PREFIX

public static final String DEFAULT_PREFIX
See Also:
Constant Field Values

DRIVER_PREFIX

public static final String DRIVER_PREFIX
See Also:
Constant Field Values

PASSWORD_CALLBACK_PREFIX

public static final String PASSWORD_CALLBACK_PREFIX
See Also:
Constant Field Values

NAME_PREFIX

public static final String NAME_PREFIX
See Also:
Constant Field Values

JMX_PREFIX

public static final String JMX_PREFIX
See Also:
Constant Field Values

FILTERS_PREFIX

public static final String FILTERS_PREFIX
See Also:
Constant Field Values
Constructor Detail

DruidDriver

public DruidDriver()
Method Detail

registerDriver

public static boolean registerDriver(Driver driver)

getInstance

public static DruidDriver getInstance()

createDataSourceId

public static int createDataSourceId()

createSqlStatId

public static int createSqlStatId()

acceptsURL

public boolean acceptsURL(String url)
                   throws SQLException
Specified by:
acceptsURL in interface Driver
Throws:
SQLException

connect

public Connection connect(String url,
                          Properties info)
                   throws SQLException
Specified by:
connect in interface Driver
Throws:
SQLException

parseConfig

public static DataSourceProxyConfig parseConfig(String url,
                                                Properties info)
                                         throws SQLException
Throws:
SQLException

createDriver

public Driver createDriver(String className)
                    throws SQLException
Throws:
SQLException

getMajorVersion

public int getMajorVersion()
Specified by:
getMajorVersion in interface DruidDriverMBean
Specified by:
getMajorVersion in interface Driver

getMinorVersion

public int getMinorVersion()
Specified by:
getMinorVersion in interface DruidDriverMBean
Specified by:
getMinorVersion in interface Driver

getPropertyInfo

public DriverPropertyInfo[] getPropertyInfo(String url,
                                            Properties info)
                                     throws SQLException
Specified by:
getPropertyInfo in interface Driver
Throws:
SQLException

jdbcCompliant

public boolean jdbcCompliant()
Specified by:
jdbcCompliant in interface DruidDriverMBean
Specified by:
jdbcCompliant in interface Driver

getConnectCount

public long getConnectCount()
Specified by:
getConnectCount in interface DruidDriverMBean

getAcceptPrefix

public String getAcceptPrefix()
Specified by:
getAcceptPrefix in interface DruidDriverMBean

getDataSourceUrls

public String[] getDataSourceUrls()
Specified by:
getDataSourceUrls in interface DruidDriverMBean

getProxyDataSources

public static ConcurrentMap<String,DataSourceProxyImpl> getProxyDataSources()

getParentLogger

public Logger getParentLogger()
                       throws SQLFeatureNotSupportedException
Throws:
SQLFeatureNotSupportedException

resetStat

public void resetStat()
Specified by:
resetStat in interface DruidDriverMBean

getDruidVersion

public String getDruidVersion()
Specified by:
getDruidVersion in interface DruidDriverMBean


Copyright © 2012 Alibaba Group. All Rights Reserved.