public class MockDriver extends Object implements Driver, MockDriverMBean
| Modifier and Type | Field and Description |
|---|---|
static MockExecuteHandler |
DEFAULT_HANDLER |
static MockDriver |
instance |
| Constructor and Description |
|---|
MockDriver() |
public static final MockExecuteHandler DEFAULT_HANDLER
public static final MockDriver instance
public boolean isLogExecuteQueryEnable()
isLogExecuteQueryEnable in interface MockDriverMBeanpublic void setLogExecuteQueryEnable(boolean logExecuteQueryEnable)
setLogExecuteQueryEnable in interface MockDriverMBeanpublic long getIdleTimeCount()
getIdleTimeCount in interface MockDriverMBeanpublic void setIdleTimeCount(long idleTimeCount)
setIdleTimeCount in interface MockDriverMBeanpublic long generateConnectionId()
public void closeAllConnections()
throws SQLException
closeAllConnections in interface MockDriverMBeanSQLExceptionpublic int getConnectionsSize()
getConnectionsSize in interface MockDriverMBeanpublic List<MockConnection> getConnections()
public long getConnectionCloseCount()
getConnectionCloseCount in interface MockDriverMBeanpublic static boolean registerDriver(Driver driver)
public MockExecuteHandler getExecuteHandler()
public void setExecuteHandler(MockExecuteHandler executeHandler)
public Connection connect(String url, Properties info) throws SQLException
connect in interface DriverSQLExceptionpublic boolean acceptsURL(String url) throws SQLException
acceptsURL in interface MockDriverMBeanacceptsURL in interface DriverSQLExceptionpublic DriverPropertyInfo[] getPropertyInfo(String url, Properties info) throws SQLException
getPropertyInfo in interface DriverSQLExceptionpublic int getMajorVersion()
getMajorVersion in interface MockDriverMBeangetMajorVersion in interface Driverpublic int getMinorVersion()
getMinorVersion in interface MockDriverMBeangetMinorVersion in interface Driverpublic boolean jdbcCompliant()
jdbcCompliant in interface MockDriverMBeanjdbcCompliant in interface Driverpublic MockResultSet createMockResultSet(MockStatementBase stmt)
public ResultSet executeQuery(MockStatementBase stmt, String sql) throws SQLException
SQLExceptionpublic void handleSleep(MockConnection conn)
public ResultSet createResultSet(MockPreparedStatement stmt)
public Logger getParentLogger() throws SQLFeatureNotSupportedException
getParentLogger in interface DriverSQLFeatureNotSupportedExceptionpublic MockConnection createMockConnection(MockDriver driver, String url, Properties connectProperties)
public MockPreparedStatement createMockPreparedStatement(MockConnection conn, String sql)
public MockStatement createMockStatement(MockConnection conn)
public MockCallableStatement createMockCallableStatement(MockConnection conn, String sql)
Copyright © 2013–2018 Alibaba Group. All rights reserved.