com.alibaba.druid.mock
Class MockDriver
java.lang.Object
com.alibaba.druid.mock.MockDriver
- All Implemented Interfaces:
- MockDriverMBean, Driver
public class MockDriver
- extends Object
- implements Driver, MockDriverMBean
DEFAULT_HANDLER
public static final MockExecuteHandler DEFAULT_HANDLER
instance
public static final MockDriver instance
MockDriver
public MockDriver()
isLogExecuteQueryEnable
public boolean isLogExecuteQueryEnable()
- Specified by:
isLogExecuteQueryEnable in interface MockDriverMBean
setLogExecuteQueryEnable
public void setLogExecuteQueryEnable(boolean logExecuteQueryEnable)
- Specified by:
setLogExecuteQueryEnable in interface MockDriverMBean
getIdleTimeCount
public long getIdleTimeCount()
- Specified by:
getIdleTimeCount in interface MockDriverMBean
setIdleTimeCount
public void setIdleTimeCount(long idleTimeCount)
- Specified by:
setIdleTimeCount in interface MockDriverMBean
generateConnectionId
public long generateConnectionId()
closeAllConnections
public void closeAllConnections()
throws SQLException
- Specified by:
closeAllConnections in interface MockDriverMBean
- Throws:
SQLException
getConnectionsSize
public int getConnectionsSize()
- Specified by:
getConnectionsSize in interface MockDriverMBean
getConnections
public List<MockConnection> getConnections()
getConnectionCloseCount
public long getConnectionCloseCount()
- Specified by:
getConnectionCloseCount in interface MockDriverMBean
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
- Specified by:
connect in interface Driver
- Throws:
SQLException
acceptsURL
public boolean acceptsURL(String url)
throws SQLException
- Specified by:
acceptsURL in interface MockDriverMBean- Specified by:
acceptsURL in interface Driver
- Throws:
SQLException
getPropertyInfo
public DriverPropertyInfo[] getPropertyInfo(String url,
Properties info)
throws SQLException
- Specified by:
getPropertyInfo in interface Driver
- Throws:
SQLException
getMajorVersion
public int getMajorVersion()
- Specified by:
getMajorVersion in interface MockDriverMBean- Specified by:
getMajorVersion in interface Driver
getMinorVersion
public int getMinorVersion()
- Specified by:
getMinorVersion in interface MockDriverMBean- Specified by:
getMinorVersion in interface Driver
jdbcCompliant
public boolean jdbcCompliant()
- Specified by:
jdbcCompliant in interface MockDriverMBean- Specified by:
jdbcCompliant in interface Driver
executeQuery
public ResultSet executeQuery(MockStatementBase stmt,
String sql)
throws SQLException
- Throws:
SQLException
handleSleep
public void handleSleep(MockConnection conn)
createResultSet
public ResultSet createResultSet(MockPreparedStatement stmt)
getParentLogger
public Logger getParentLogger()
throws SQLFeatureNotSupportedException
- Throws:
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 © 2012 Alibaba Group. All Rights Reserved.