com.alibaba.druid.mock
类 MockDriver

java.lang.Object
  继承者 com.alibaba.druid.mock.MockDriver
所有已实现的接口:
MockDriverMBean, Driver

public class MockDriver
extends Object
implements Driver, MockDriverMBean


字段摘要
static MockExecuteHandler DEFAULT_HANDLER
           
static MockDriver instance
           
 
构造方法摘要
MockDriver()
           
 
方法摘要
 boolean acceptsURL(String url)
           
 void closeAllConnections()
           
 Connection connect(String url, Properties info)
           
 MockCallableStatement createMockCallableStatement(MockConnection conn, String sql)
           
 MockConnection createMockConnection(MockDriver driver, String url, Properties connectProperties)
           
 MockPreparedStatement createMockPreparedStatement(MockConnection conn, String sql)
           
 MockResultSet createMockResultSet(MockStatementBase stmt)
           
 MockStatement createMockStatement(MockConnection conn)
           
 ResultSet createResultSet(MockPreparedStatement stmt)
           
 ResultSet executeQuery(MockStatementBase stmt, String sql)
           
 long generateConnectionId()
           
 long getConnectionCloseCount()
           
 List<MockConnection> getConnections()
           
 int getConnectionsSize()
           
 MockExecuteHandler getExecuteHandler()
           
 long getIdleTimeCount()
           
 int getMajorVersion()
           
 int getMinorVersion()
           
 Logger getParentLogger()
           
 DriverPropertyInfo[] getPropertyInfo(String url, Properties info)
           
 void handleSleep(MockConnection conn)
           
 boolean isLogExecuteQueryEnable()
           
 boolean jdbcCompliant()
           
static boolean registerDriver(Driver driver)
           
 void setExecuteHandler(MockExecuteHandler executeHandler)
           
 void setIdleTimeCount(long idleTimeCount)
           
 void setLogExecuteQueryEnable(boolean logExecuteQueryEnable)
           
 
从类 java.lang.Object 继承的方法
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

字段详细信息

DEFAULT_HANDLER

public static final MockExecuteHandler DEFAULT_HANDLER

instance

public static final MockDriver instance
构造方法详细信息

MockDriver

public MockDriver()
方法详细信息

isLogExecuteQueryEnable

public boolean isLogExecuteQueryEnable()
指定者:
接口 MockDriverMBean 中的 isLogExecuteQueryEnable

setLogExecuteQueryEnable

public void setLogExecuteQueryEnable(boolean logExecuteQueryEnable)
指定者:
接口 MockDriverMBean 中的 setLogExecuteQueryEnable

getIdleTimeCount

public long getIdleTimeCount()
指定者:
接口 MockDriverMBean 中的 getIdleTimeCount

setIdleTimeCount

public void setIdleTimeCount(long idleTimeCount)
指定者:
接口 MockDriverMBean 中的 setIdleTimeCount

generateConnectionId

public long generateConnectionId()

closeAllConnections

public void closeAllConnections()
                         throws SQLException
指定者:
接口 MockDriverMBean 中的 closeAllConnections
抛出:
SQLException

getConnectionsSize

public int getConnectionsSize()
指定者:
接口 MockDriverMBean 中的 getConnectionsSize

getConnections

public List<MockConnection> getConnections()

getConnectionCloseCount

public long getConnectionCloseCount()
指定者:
接口 MockDriverMBean 中的 getConnectionCloseCount

registerDriver

public static boolean registerDriver(Driver driver)

getExecuteHandler

public MockExecuteHandler getExecuteHandler()

setExecuteHandler

public void setExecuteHandler(MockExecuteHandler executeHandler)

connect

public Connection connect(String url,
                          Properties info)
                   throws SQLException
指定者:
接口 Driver 中的 connect
抛出:
SQLException

acceptsURL

public boolean acceptsURL(String url)
                   throws SQLException
指定者:
接口 MockDriverMBean 中的 acceptsURL
指定者:
接口 Driver 中的 acceptsURL
抛出:
SQLException

getPropertyInfo

public DriverPropertyInfo[] getPropertyInfo(String url,
                                            Properties info)
                                     throws SQLException
指定者:
接口 Driver 中的 getPropertyInfo
抛出:
SQLException

getMajorVersion

public int getMajorVersion()
指定者:
接口 MockDriverMBean 中的 getMajorVersion
指定者:
接口 Driver 中的 getMajorVersion

getMinorVersion

public int getMinorVersion()
指定者:
接口 MockDriverMBean 中的 getMinorVersion
指定者:
接口 Driver 中的 getMinorVersion

jdbcCompliant

public boolean jdbcCompliant()
指定者:
接口 MockDriverMBean 中的 jdbcCompliant
指定者:
接口 Driver 中的 jdbcCompliant

createMockResultSet

public MockResultSet createMockResultSet(MockStatementBase stmt)

executeQuery

public ResultSet executeQuery(MockStatementBase stmt,
                              String sql)
                       throws SQLException
抛出:
SQLException

handleSleep

public void handleSleep(MockConnection conn)

createResultSet

public ResultSet createResultSet(MockPreparedStatement stmt)

getParentLogger

public Logger getParentLogger()
                       throws SQLFeatureNotSupportedException
抛出:
SQLFeatureNotSupportedException

createMockConnection

public MockConnection createMockConnection(MockDriver driver,
                                           String url,
                                           Properties connectProperties)

createMockPreparedStatement

public MockPreparedStatement createMockPreparedStatement(MockConnection conn,
                                                         String sql)

createMockStatement

public MockStatement createMockStatement(MockConnection conn)

createMockCallableStatement

public MockCallableStatement createMockCallableStatement(MockConnection conn,
                                                         String sql)


Copyright © 2013-2014 Alibaba Group. All Rights Reserved.