com.github.smokestack.jdbc
Class MockStatement

java.lang.Object
  extended by com.github.smokestack.jdbc.MockStatement
All Implemented Interfaces:
Statement
Direct Known Subclasses:
MockPreparedStatement

public class MockStatement
extends Object
implements Statement

Author:
gliptak

Nested Class Summary
static class MockStatement.StatementState
           
 
Field Summary
protected  MockStatement.StatementState mockState
           
 
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
 void _addBatch(String sql)
           
 void _cancel()
           
 void _clearBatch()
           
 void _clearWarnings()
           
 void _close()
           
 boolean _execute(String sql)
           
 boolean _execute(String sql, int autoGeneratedKeys)
           
 boolean _execute(String sql, int[] columnIndexes)
           
 boolean _execute(String sql, String[] columnNames)
           
 int[] _executeBatch()
           
 void _executeQuery(String sql)
           
 int _executeUpdate(String sql)
           
 int _executeUpdate(String sql, int autoGeneratedKeys)
           
 int _executeUpdate(String sql, int[] columnIndexes)
           
 int _executeUpdate(String sql, String[] columnNames)
           
 Connection _getConnection()
           
 int _getFetchDirection()
           
 int _getFetchSize()
           
 int _getMaxFieldSize()
           
 int _getMaxRows()
           
 boolean _getMoreResults()
           
 boolean _getMoreResults(int current)
           
 int _getQueryTimeout()
           
 ResultSet _getResultSet()
           
 int _getResultSetConcurrency()
           
 int _getResultSetHoldability()
           
 int _getResultSetType()
           
 int _getUpdateCount()
           
 SQLWarning _getWarnings()
           
 void _setCursorName(String name)
           
 void _setEscapeProcessing(boolean enable)
           
 void _setFetchDirection(int direction)
           
 void _setFetchSize(int rows)
           
 void _setMaxFieldSize(int max)
           
 void _setMaxRows(int max)
           
 void _setQueryTimeout(int seconds)
           
 void addBatch(String sql)
           
 void assertClosed()
           
 void assertExplicitClose()
           
protected  void autoClose()
           
 void cancel()
           
 void clearBatch()
           
 void clearWarnings()
           
 void close()
           
 void complete()
           
 boolean execute(String sql)
           
 boolean execute(String sql, int autoGeneratedKeys)
           
 boolean execute(String sql, int[] columnIndexes)
           
 boolean execute(String sql, String[] columnNames)
           
 int[] executeBatch()
           
 ResultSet executeQuery(String sql)
           
 int executeUpdate(String sql)
           
 int executeUpdate(String sql, int autoGeneratedKeys)
           
 int executeUpdate(String sql, int[] columnIndexes)
           
 int executeUpdate(String sql, String[] columnNames)
           
 Connection getConnection()
           
 int getFetchDirection()
           
 int getFetchSize()
           
 ResultSet getGeneratedKeys()
           
 long getId()
           
 int getMaxFieldSize()
           
 int getMaxRows()
           
 List<MockResultSet> getMockResultSets()
           
 boolean getMoreResults()
           
 boolean getMoreResults(int current)
           
 int getQueryTimeout()
           
 ResultSet getResultSet()
           
 int getResultSetConcurrency()
           
 int getResultSetHoldability()
           
 int getResultSetType()
           
 int getUpdateCount()
           
 SQLWarning getWarnings()
           
 void setCursorName(String name)
           
 void setEscapeProcessing(boolean enable)
           
 void setFetchDirection(int direction)
           
 void setFetchSize(int rows)
           
 void setHoldability(int resultSetHoldability)
           
 void setId(int id)
           
 void setMaxFieldSize(int max)
           
 void setMaxRows(int max)
           
 void setParent(MockConnection mockConnection)
           
 void setQueryTimeout(int seconds)
           
 void setResultSetConcurrency(int resultSetConcurrency)
           
 void setResultType(int resultSetType)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

mockState

protected MockStatement.StatementState mockState
Constructor Detail

MockStatement

public MockStatement(Connection connection)
Method Detail

addBatch

public void addBatch(String sql)
              throws SQLException
Specified by:
addBatch in interface Statement
Throws:
SQLException

_addBatch

public void _addBatch(String sql)

cancel

public void cancel()
            throws SQLException
Specified by:
cancel in interface Statement
Throws:
SQLException

_cancel

public void _cancel()
             throws SQLException
Throws:
SQLException

clearBatch

public void clearBatch()
                throws SQLException
Specified by:
clearBatch in interface Statement
Throws:
SQLException

_clearBatch

public void _clearBatch()

clearWarnings

public void clearWarnings()
                   throws SQLException
Specified by:
clearWarnings in interface Statement
Throws:
SQLException

_clearWarnings

public void _clearWarnings()

close

public void close()
           throws SQLException
Specified by:
close in interface Statement
Throws:
SQLException

_close

public void _close()
            throws SQLException
Throws:
SQLException

execute

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

_execute

public boolean _execute(String sql)
                 throws SQLException
Throws:
SQLException

execute

public boolean execute(String sql,
                       int autoGeneratedKeys)
                throws SQLException
Specified by:
execute in interface Statement
Throws:
SQLException

_execute

public boolean _execute(String sql,
                        int autoGeneratedKeys)

execute

public boolean execute(String sql,
                       int[] columnIndexes)
                throws SQLException
Specified by:
execute in interface Statement
Throws:
SQLException

_execute

public boolean _execute(String sql,
                        int[] columnIndexes)

execute

public boolean execute(String sql,
                       String[] columnNames)
                throws SQLException
Specified by:
execute in interface Statement
Throws:
SQLException

_execute

public boolean _execute(String sql,
                        String[] columnNames)

executeBatch

public int[] executeBatch()
                   throws SQLException
Specified by:
executeBatch in interface Statement
Throws:
SQLException

_executeBatch

public int[] _executeBatch()
                    throws SQLException
Throws:
SQLException

executeQuery

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

_executeQuery

public void _executeQuery(String sql)

executeUpdate

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

_executeUpdate

public int _executeUpdate(String sql)
                   throws SQLException
Throws:
SQLException

executeUpdate

public int executeUpdate(String sql,
                         int autoGeneratedKeys)
                  throws SQLException
Specified by:
executeUpdate in interface Statement
Throws:
SQLException

_executeUpdate

public int _executeUpdate(String sql,
                          int autoGeneratedKeys)
                   throws SQLException
Throws:
SQLException

executeUpdate

public int executeUpdate(String sql,
                         int[] columnIndexes)
                  throws SQLException
Specified by:
executeUpdate in interface Statement
Throws:
SQLException

_executeUpdate

public int _executeUpdate(String sql,
                          int[] columnIndexes)
                   throws SQLException
Throws:
SQLException

executeUpdate

public int executeUpdate(String sql,
                         String[] columnNames)
                  throws SQLException
Specified by:
executeUpdate in interface Statement
Throws:
SQLException

_executeUpdate

public int _executeUpdate(String sql,
                          String[] columnNames)
                   throws SQLException
Throws:
SQLException

getConnection

public Connection getConnection()
                         throws SQLException
Specified by:
getConnection in interface Statement
Throws:
SQLException

_getConnection

public Connection _getConnection()

getFetchDirection

public int getFetchDirection()
                      throws SQLException
Specified by:
getFetchDirection in interface Statement
Throws:
SQLException

_getFetchDirection

public int _getFetchDirection()

getFetchSize

public int getFetchSize()
                 throws SQLException
Specified by:
getFetchSize in interface Statement
Throws:
SQLException

_getFetchSize

public int _getFetchSize()

getGeneratedKeys

public ResultSet getGeneratedKeys()
                           throws SQLException
Specified by:
getGeneratedKeys in interface Statement
Throws:
SQLException

getMaxFieldSize

public int getMaxFieldSize()
                    throws SQLException
Specified by:
getMaxFieldSize in interface Statement
Throws:
SQLException

_getMaxFieldSize

public int _getMaxFieldSize()

getMaxRows

public int getMaxRows()
               throws SQLException
Specified by:
getMaxRows in interface Statement
Throws:
SQLException

_getMaxRows

public int _getMaxRows()

getMoreResults

public boolean getMoreResults()
                       throws SQLException
Specified by:
getMoreResults in interface Statement
Throws:
SQLException

_getMoreResults

public boolean _getMoreResults()

getMoreResults

public boolean getMoreResults(int current)
                       throws SQLException
Specified by:
getMoreResults in interface Statement
Throws:
SQLException

_getMoreResults

public boolean _getMoreResults(int current)

getQueryTimeout

public int getQueryTimeout()
                    throws SQLException
Specified by:
getQueryTimeout in interface Statement
Throws:
SQLException

_getQueryTimeout

public int _getQueryTimeout()

getResultSet

public ResultSet getResultSet()
                       throws SQLException
Specified by:
getResultSet in interface Statement
Throws:
SQLException

_getResultSet

public ResultSet _getResultSet()

getResultSetConcurrency

public int getResultSetConcurrency()
                            throws SQLException
Specified by:
getResultSetConcurrency in interface Statement
Throws:
SQLException

_getResultSetConcurrency

public int _getResultSetConcurrency()

getResultSetHoldability

public int getResultSetHoldability()
                            throws SQLException
Specified by:
getResultSetHoldability in interface Statement
Throws:
SQLException

_getResultSetHoldability

public int _getResultSetHoldability()

getResultSetType

public int getResultSetType()
                     throws SQLException
Specified by:
getResultSetType in interface Statement
Throws:
SQLException

_getResultSetType

public int _getResultSetType()

getUpdateCount

public int getUpdateCount()
                   throws SQLException
Specified by:
getUpdateCount in interface Statement
Throws:
SQLException

_getUpdateCount

public int _getUpdateCount()

getWarnings

public SQLWarning getWarnings()
                       throws SQLException
Specified by:
getWarnings in interface Statement
Throws:
SQLException

_getWarnings

public SQLWarning _getWarnings()

setCursorName

public void setCursorName(String name)
                   throws SQLException
Specified by:
setCursorName in interface Statement
Throws:
SQLException

_setCursorName

public void _setCursorName(String name)

setEscapeProcessing

public void setEscapeProcessing(boolean enable)
                         throws SQLException
Specified by:
setEscapeProcessing in interface Statement
Throws:
SQLException

_setEscapeProcessing

public void _setEscapeProcessing(boolean enable)

setFetchDirection

public void setFetchDirection(int direction)
                       throws SQLException
Specified by:
setFetchDirection in interface Statement
Throws:
SQLException

_setFetchDirection

public void _setFetchDirection(int direction)

setFetchSize

public void setFetchSize(int rows)
                  throws SQLException
Specified by:
setFetchSize in interface Statement
Throws:
SQLException

_setFetchSize

public void _setFetchSize(int rows)

setMaxFieldSize

public void setMaxFieldSize(int max)
                     throws SQLException
Specified by:
setMaxFieldSize in interface Statement
Throws:
SQLException

_setMaxFieldSize

public void _setMaxFieldSize(int max)

setMaxRows

public void setMaxRows(int max)
                throws SQLException
Specified by:
setMaxRows in interface Statement
Throws:
SQLException

_setMaxRows

public void _setMaxRows(int max)

setQueryTimeout

public void setQueryTimeout(int seconds)
                     throws SQLException
Specified by:
setQueryTimeout in interface Statement
Throws:
SQLException

_setQueryTimeout

public void _setQueryTimeout(int seconds)

getMockResultSets

public List<MockResultSet> getMockResultSets()
Returns:
the mockResultSets

autoClose

protected void autoClose()

complete

public void complete()

getId

public long getId()

setParent

public void setParent(MockConnection mockConnection)

setId

public void setId(int id)

setResultType

public void setResultType(int resultSetType)

setResultSetConcurrency

public void setResultSetConcurrency(int resultSetConcurrency)

setHoldability

public void setHoldability(int resultSetHoldability)

assertExplicitClose

public void assertExplicitClose()

assertClosed

public void assertClosed()

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2009-2010 Smokestack. All Rights Reserved.