com.alibaba.druid.mock
Class MockStatement

java.lang.Object
  extended by com.alibaba.druid.util.jdbc.StatementBase
      extended by com.alibaba.druid.mock.MockStatement
All Implemented Interfaces:
MockStatementBase, Statement, Wrapper

public class MockStatement
extends StatementBase
implements MockStatementBase, Statement


Field Summary
static String ERROR_SQL
           
 
Fields inherited from interface java.sql.Statement
CLOSE_ALL_RESULTS, CLOSE_CURRENT_RESULT, EXECUTE_FAILED, KEEP_CURRENT_RESULT, NO_GENERATED_KEYS, RETURN_GENERATED_KEYS, SUCCESS_NO_INFO
 
Constructor Summary
MockStatement(Connection connection)
           
 
Method Summary
 boolean execute(String sql)
           
 ResultSet executeQuery(String sql)
           
 int executeUpdate(String sql)
           
 MockConnection getConnection()
           
 void setFakeConnection(MockConnection fakeConnection)
           
 
Methods inherited from class com.alibaba.druid.util.jdbc.StatementBase
addBatch, cancel, clearBatch, clearWarnings, close, closeOnCompletion, execute, execute, execute, executeBatch, executeUpdate, executeUpdate, executeUpdate, getCursorName, getFetchDirection, getFetchSize, getGeneratedKeys, getMaxFieldSize, getMaxRows, getMoreResults, getMoreResults, getQueryTimeout, getResultSet, getResultSetConcurrency, getResultSetHoldability, getResultSetType, getUpdateCount, getWarnings, isClosed, isCloseOnCompletion, isEscapeProcessing, isPoolable, isWrapperFor, setConnection, setCursorName, setEscapeProcessing, setFetchDirection, setFetchSize, setGeneratedKeys, setMaxFieldSize, setMaxRows, setPoolable, setQueryTimeout, setResultSet, setResultSetConcurrency, setResultSetHoldability, setResultSetType, setUpdateCount, setWarning, setWarnings, unwrap
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.sql.Statement
addBatch, cancel, clearBatch, clearWarnings, close, execute, execute, execute, executeBatch, executeUpdate, executeUpdate, executeUpdate, getFetchDirection, getFetchSize, getGeneratedKeys, getMaxFieldSize, getMaxRows, getMoreResults, getMoreResults, getQueryTimeout, getResultSet, getResultSetConcurrency, getResultSetHoldability, getResultSetType, getUpdateCount, getWarnings, isClosed, isPoolable, setCursorName, setEscapeProcessing, setFetchDirection, setFetchSize, setMaxFieldSize, setMaxRows, setPoolable, setQueryTimeout
 
Methods inherited from interface java.sql.Wrapper
isWrapperFor, unwrap
 

Field Detail

ERROR_SQL

public static final String ERROR_SQL
See Also:
Constant Field Values
Constructor Detail

MockStatement

public MockStatement(Connection connection)
Method Detail

getConnection

public MockConnection getConnection()
Specified by:
getConnection in interface MockStatementBase
Specified by:
getConnection in interface Statement
Overrides:
getConnection in class StatementBase

setFakeConnection

public void setFakeConnection(MockConnection fakeConnection)

executeQuery

public ResultSet executeQuery(String sql)
                       throws SQLException
Specified by:
executeQuery in interface Statement
Overrides:
executeQuery in class StatementBase
Throws:
SQLException

executeUpdate

public int executeUpdate(String sql)
                  throws SQLException
Specified by:
executeUpdate in interface Statement
Overrides:
executeUpdate in class StatementBase
Throws:
SQLException

execute

public boolean execute(String sql)
                throws SQLException
Specified by:
execute in interface Statement
Overrides:
execute in class StatementBase
Throws:
SQLException


Copyright © 2012 Alibaba Group. All Rights Reserved.