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 MockDriverMBean
public void setLogExecuteQueryEnable(boolean logExecuteQueryEnable)
setLogExecuteQueryEnable
in interface MockDriverMBean
public long getIdleTimeCount()
getIdleTimeCount
in interface MockDriverMBean
public void setIdleTimeCount(long idleTimeCount)
setIdleTimeCount
in interface MockDriverMBean
public long generateConnectionId()
public void closeAllConnections() throws SQLException
closeAllConnections
in interface MockDriverMBean
SQLException
public int getConnectionsSize()
getConnectionsSize
in interface MockDriverMBean
public List<MockConnection> getConnections()
public long getConnectionCloseCount()
getConnectionCloseCount
in interface MockDriverMBean
public 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 Driver
SQLException
public boolean acceptsURL(String url) throws SQLException
acceptsURL
in interface MockDriverMBean
acceptsURL
in interface Driver
SQLException
public DriverPropertyInfo[] getPropertyInfo(String url, Properties info) throws SQLException
getPropertyInfo
in interface Driver
SQLException
public int getMajorVersion()
getMajorVersion
in interface MockDriverMBean
getMajorVersion
in interface Driver
public int getMinorVersion()
getMinorVersion
in interface MockDriverMBean
getMinorVersion
in interface Driver
public boolean jdbcCompliant()
jdbcCompliant
in interface MockDriverMBean
jdbcCompliant
in interface Driver
public MockResultSet createMockResultSet(MockStatementBase stmt)
public ResultSet executeQuery(MockStatementBase stmt, String sql) throws SQLException
SQLException
public void handleSleep(MockConnection conn)
public ResultSet createResultSet(MockPreparedStatement stmt)
public Logger getParentLogger() throws SQLFeatureNotSupportedException
getParentLogger
in interface Driver
SQLFeatureNotSupportedException
public 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–2017 Alibaba Group. All rights reserved.