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


字段摘要
 
从接口 java.sql.Connection 继承的字段
TRANSACTION_NONE, TRANSACTION_READ_COMMITTED, TRANSACTION_READ_UNCOMMITTED, TRANSACTION_REPEATABLE_READ, TRANSACTION_SERIALIZABLE
 
构造方法摘要
MockConnection()
           
MockConnection(MockDriver driver, String url, Properties connectProperties)
           
 
方法摘要
 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)
           
<T> T
unwrap(Class<T> iface)
           
 
从类 com.alibaba.druid.util.jdbc.ConnectionBase 继承的方法
clearWarnings, getAutoCommit, getCatalog, getConnectProperties, getHoldability, getTransactionIsolation, getUrl, getWarnings, isReadOnly, setCatalog, setHoldability, setTransactionIsolation, setWarings
 
从类 java.lang.Object 继承的方法
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
从接口 java.sql.Connection 继承的方法
clearWarnings, getAutoCommit, getCatalog, getHoldability, getTransactionIsolation, getWarnings, isReadOnly, setCatalog, setHoldability, setTransactionIsolation
 

构造方法详细信息

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 Alibaba Group. All Rights Reserved.