com.alibaba.druid.mock
类 MockConnection
java.lang.Object
com.alibaba.druid.util.jdbc.ConnectionBase
com.alibaba.druid.mock.MockConnection
- 所有已实现的接口:
- Connection, Wrapper
public class MockConnection
- extends ConnectionBase
- implements Connection
|
方法摘要 |
void |
abort(Executor executor)
|
void |
checkState()
|
void |
close()
|
void |
commit()
|
Array |
createArrayOf(String typeName,
Object[] elements)
|
Blob |
createBlob()
|
Clob |
createClob()
|
NClob |
createNClob()
|
SQLXML |
createSQLXML()
|
Statement |
createStatement()
|
Statement |
createStatement(int resultSetType,
int resultSetConcurrency)
|
Statement |
createStatement(int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
|
Struct |
createStruct(String typeName,
Object[] attributes)
|
Properties |
getClientInfo()
|
String |
getClientInfo(String name)
|
long |
getCreatedTimeMillis()
|
MockDriver |
getDriver()
|
SQLException |
getError()
|
long |
getId()
|
long |
getLastActiveTimeMillis()
|
String |
getLastSql()
|
DatabaseMetaData |
getMetaData()
|
int |
getNetworkTimeout()
|
List<Savepoint> |
getSavepoints()
|
String |
getSchema()
|
Map<String,Class<?>> |
getTypeMap()
|
void |
handleSleep()
|
boolean |
isClosed()
|
boolean |
isValid(int timeout)
|
boolean |
isWrapperFor(Class<?> iface)
|
String |
nativeSQL(String sql)
|
CallableStatement |
prepareCall(String sql)
|
CallableStatement |
prepareCall(String sql,
int resultSetType,
int resultSetConcurrency)
|
CallableStatement |
prepareCall(String sql,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
|
PreparedStatement |
prepareStatement(String sql)
|
PreparedStatement |
prepareStatement(String sql,
int autoGeneratedKeys)
|
PreparedStatement |
prepareStatement(String sql,
int[] columnIndexes)
|
PreparedStatement |
prepareStatement(String sql,
int resultSetType,
int resultSetConcurrency)
|
PreparedStatement |
prepareStatement(String sql,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
|
PreparedStatement |
prepareStatement(String sql,
String[] columnNames)
|
void |
releaseSavepoint(Savepoint savepoint)
|
void |
rollback()
|
void |
rollback(Savepoint savepoint)
|
void |
setAutoCommit(boolean autoCommit)
|
void |
setClientInfo(Properties properties)
|
void |
setClientInfo(String name,
String value)
|
void |
setDriver(MockDriver driver)
|
void |
setError(SQLException error)
|
void |
setLastActiveTimeMillis(long lastActiveTimeMillis)
|
void |
setLastSql(String lastSql)
|
void |
setNetworkTimeout(Executor executor,
int milliseconds)
|
void |
setReadOnly(boolean readOnly)
|
Savepoint |
setSavepoint()
|
Savepoint |
setSavepoint(String name)
|
void |
setSchema(String schema)
|
void |
setTypeMap(Map<String,Class<?>> map)
|
|
unwrap(Class<T> iface)
|
| 从类 com.alibaba.druid.util.jdbc.ConnectionBase 继承的方法 |
clearWarnings, getAutoCommit, getCatalog, getConnectProperties, getHoldability, getTransactionIsolation, getUrl, getWarnings, isReadOnly, setCatalog, setHoldability, setTransactionIsolation, setWarings |
MockConnection
public MockConnection()
MockConnection
public MockConnection(MockDriver driver,
String url,
Properties connectProperties)
getLastSql
public String getLastSql()
setLastSql
public void setLastSql(String lastSql)
getError
public SQLException getError()
setError
public void setError(SQLException error)
getSavepoints
public List<Savepoint> getSavepoints()
getLastActiveTimeMillis
public long getLastActiveTimeMillis()
setLastActiveTimeMillis
public void setLastActiveTimeMillis(long lastActiveTimeMillis)
getCreatedTimeMillis
public long getCreatedTimeMillis()
getId
public long getId()
getDriver
public MockDriver getDriver()
setDriver
public void setDriver(MockDriver driver)
unwrap
public <T> T unwrap(Class<T> iface)
throws SQLException
- 指定者:
- 接口
Wrapper 中的 unwrap
- 抛出:
SQLException
isWrapperFor
public boolean isWrapperFor(Class<?> iface)
throws SQLException
- 指定者:
- 接口
Wrapper 中的 isWrapperFor
- 抛出:
SQLException
createStatement
public Statement createStatement()
throws SQLException
- 指定者:
- 接口
Connection 中的 createStatement
- 抛出:
SQLException
prepareStatement
public PreparedStatement prepareStatement(String sql)
throws SQLException
- 指定者:
- 接口
Connection 中的 prepareStatement
- 抛出:
SQLException
prepareCall
public CallableStatement prepareCall(String sql)
throws SQLException
- 指定者:
- 接口
Connection 中的 prepareCall
- 抛出:
SQLException
nativeSQL
public String nativeSQL(String sql)
throws SQLException
- 指定者:
- 接口
Connection 中的 nativeSQL
- 抛出:
SQLException
setAutoCommit
public void setAutoCommit(boolean autoCommit)
throws SQLException
- 指定者:
- 接口
Connection 中的 setAutoCommit - 覆盖:
- 类
ConnectionBase 中的 setAutoCommit
- 抛出:
SQLException
commit
public void commit()
throws SQLException
- 指定者:
- 接口
Connection 中的 commit
- 抛出:
SQLException
rollback
public void rollback()
throws SQLException
- 指定者:
- 接口
Connection 中的 rollback
- 抛出:
SQLException
close
public void close()
throws SQLException
- 指定者:
- 接口
Connection 中的 close
- 抛出:
SQLException
isClosed
public boolean isClosed()
throws SQLException
- 指定者:
- 接口
Connection 中的 isClosed
- 抛出:
SQLException
getMetaData
public DatabaseMetaData getMetaData()
throws SQLException
- 指定者:
- 接口
Connection 中的 getMetaData
- 抛出:
SQLException
createStatement
public Statement createStatement(int resultSetType,
int resultSetConcurrency)
throws SQLException
- 指定者:
- 接口
Connection 中的 createStatement
- 抛出:
SQLException
prepareStatement
public PreparedStatement prepareStatement(String sql,
int resultSetType,
int resultSetConcurrency)
throws SQLException
- 指定者:
- 接口
Connection 中的 prepareStatement
- 抛出:
SQLException
prepareCall
public CallableStatement prepareCall(String sql,
int resultSetType,
int resultSetConcurrency)
throws SQLException
- 指定者:
- 接口
Connection 中的 prepareCall
- 抛出:
SQLException
getTypeMap
public Map<String,Class<?>> getTypeMap()
throws SQLException
- 指定者:
- 接口
Connection 中的 getTypeMap - 覆盖:
- 类
ConnectionBase 中的 getTypeMap
- 抛出:
SQLException
setTypeMap
public void setTypeMap(Map<String,Class<?>> map)
throws SQLException
- 指定者:
- 接口
Connection 中的 setTypeMap - 覆盖:
- 类
ConnectionBase 中的 setTypeMap
- 抛出:
SQLException
setSavepoint
public Savepoint setSavepoint()
throws SQLException
- 指定者:
- 接口
Connection 中的 setSavepoint
- 抛出:
SQLException
setSavepoint
public Savepoint setSavepoint(String name)
throws SQLException
- 指定者:
- 接口
Connection 中的 setSavepoint
- 抛出:
SQLException
checkState
public void checkState()
throws SQLException
- 覆盖:
- 类
ConnectionBase 中的 checkState
- 抛出:
SQLException
rollback
public void rollback(Savepoint savepoint)
throws SQLException
- 指定者:
- 接口
Connection 中的 rollback
- 抛出:
SQLException
releaseSavepoint
public void releaseSavepoint(Savepoint savepoint)
throws SQLException
- 指定者:
- 接口
Connection 中的 releaseSavepoint
- 抛出:
SQLException
createStatement
public Statement createStatement(int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
throws SQLException
- 指定者:
- 接口
Connection 中的 createStatement
- 抛出:
SQLException
prepareStatement
public PreparedStatement prepareStatement(String sql,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
throws SQLException
- 指定者:
- 接口
Connection 中的 prepareStatement
- 抛出:
SQLException
prepareCall
public CallableStatement prepareCall(String sql,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
throws SQLException
- 指定者:
- 接口
Connection 中的 prepareCall
- 抛出:
SQLException
prepareStatement
public PreparedStatement prepareStatement(String sql,
int autoGeneratedKeys)
throws SQLException
- 指定者:
- 接口
Connection 中的 prepareStatement
- 抛出:
SQLException
prepareStatement
public PreparedStatement prepareStatement(String sql,
int[] columnIndexes)
throws SQLException
- 指定者:
- 接口
Connection 中的 prepareStatement
- 抛出:
SQLException
prepareStatement
public PreparedStatement prepareStatement(String sql,
String[] columnNames)
throws SQLException
- 指定者:
- 接口
Connection 中的 prepareStatement
- 抛出:
SQLException
createClob
public Clob createClob()
throws SQLException
- 指定者:
- 接口
Connection 中的 createClob
- 抛出:
SQLException
createBlob
public Blob createBlob()
throws SQLException
- 指定者:
- 接口
Connection 中的 createBlob
- 抛出:
SQLException
createNClob
public NClob createNClob()
throws SQLException
- 指定者:
- 接口
Connection 中的 createNClob
- 抛出:
SQLException
createSQLXML
public SQLXML createSQLXML()
throws SQLException
- 指定者:
- 接口
Connection 中的 createSQLXML
- 抛出:
SQLException
isValid
public boolean isValid(int timeout)
throws SQLException
- 指定者:
- 接口
Connection 中的 isValid
- 抛出:
SQLException
setClientInfo
public void setClientInfo(String name,
String value)
throws SQLClientInfoException
- 指定者:
- 接口
Connection 中的 setClientInfo
- 抛出:
SQLClientInfoException
setClientInfo
public void setClientInfo(Properties properties)
throws SQLClientInfoException
- 指定者:
- 接口
Connection 中的 setClientInfo
- 抛出:
SQLClientInfoException
getClientInfo
public String getClientInfo(String name)
throws SQLException
- 指定者:
- 接口
Connection 中的 getClientInfo
- 抛出:
SQLException
getClientInfo
public Properties getClientInfo()
throws SQLException
- 指定者:
- 接口
Connection 中的 getClientInfo
- 抛出:
SQLException
createArrayOf
public Array createArrayOf(String typeName,
Object[] elements)
throws SQLException
- 指定者:
- 接口
Connection 中的 createArrayOf
- 抛出:
SQLException
createStruct
public Struct createStruct(String typeName,
Object[] attributes)
throws SQLException
- 指定者:
- 接口
Connection 中的 createStruct
- 抛出:
SQLException
setSchema
public void setSchema(String schema)
throws SQLException
- 抛出:
SQLException
getSchema
public String getSchema()
throws SQLException
- 抛出:
SQLException
abort
public void abort(Executor executor)
throws SQLException
- 抛出:
SQLException
setNetworkTimeout
public void setNetworkTimeout(Executor executor,
int milliseconds)
throws SQLException
- 抛出:
SQLException
getNetworkTimeout
public int getNetworkTimeout()
throws SQLException
- 抛出:
SQLException
setReadOnly
public void setReadOnly(boolean readOnly)
throws SQLException
- 指定者:
- 接口
Connection 中的 setReadOnly - 覆盖:
- 类
ConnectionBase 中的 setReadOnly
- 抛出:
SQLException
handleSleep
public void handleSleep()
Copyright © 2013-2014 Alibaba Group. All Rights Reserved.