Package com.mockobjects.sql
Class MockPreparedStatement
java.lang.Object
com.mockobjects.MockObject
com.mockobjects.sql.MockPreparedStatement
- All Implemented Interfaces:
Verifiable,AutoCloseable,PreparedStatement,Statement,Wrapper
-
Field Summary
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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddBatch()Calls notImplemented.voidvoidaddExpectedExecute(String queryString, boolean success) voidaddExpectedExecuteQuery(String queryString, ResultSet resultSet) voidaddExpectedExecuteUpdate(String queryString, int updateCount) voidaddExpectedSetParameter(int parameterIndex, int intValue) voidaddExpectedSetParameter(int parameterIndex, Object parameterValue) voidaddExpectedSetParameters(Object[] parameters) voidaddExpectedTargetSQLType(int aTargetSQLType) voidaddResultSet(com.mockobjects.sql.MockResultSet aResultSet) voidaddUpdateCount(int count) Added value to be returned by executeUpdate()voidcancel()voidvoidvoidvoidclose()booleanexecute()Calls innerExecute() (see CommonMockStatement).booleanint[]Returns executeQuery(String) with an empty String.executeQuery(String sql) intReturns value set with addUpdateCountintexecuteUpdate(String sql) intintintintCalls notImplemented.booleanintintintintvoidvoidsetAsciiStream(int param, InputStream inputStream, int length) Calls notImplemented.voidsetBigDecimal(int param, BigDecimal bigDecimal) voidsetBinaryStream(int param, InputStream inputStream, int length) Calls notImplemented.voidvoidsetBoolean(int param, boolean aBoolean) voidsetByte(int param, byte aByte) voidsetBytes(int param, byte[] values) voidsetCharacterStream(int param, Reader reader, int length) Calls notImplemented.voidvoidsetCursorName(String name) voidvoidvoidsetDouble(int param, double aDouble) voidsetEscapeProcessing(boolean enable) voidsetExpectedClearParametersCalls(int callCount) voidsetExpectedCloseCalls(int callCount) voidvoidsetFetchDirection(int direction) voidsetFetchSize(int rows) voidsetFloat(int param, float aFloat) voidsetInt(int parameterIndex, int x) voidsetLong(int param, long aLong) voidsetMaxFieldSize(int max) voidsetMaxRows(int max) voidsetNull(int param, int param1) voidCalls notImplemented.voidvoidvoidCalls notImplemented.voidsetQueryTimeout(int seconds) voidvoidsetShort(int param, short aShort) voidvoidvoidvoidsetTimestamp(int param, Timestamp timestamp) voidsetTimestamp(int param, Timestamp timestamp, Calendar calendar) Calls notImplemented.voidsetUnicodeStream(int param, InputStream inputStream, int length) Calls notImplemented.voidsetupConnection(Connection conn) voidsetupThrowExceptionOnExecute(SQLException exception) voidsetupUpdateCount(int updateCount) Methods inherited from class com.mockobjects.MockObject
notImplemented, notYetImplemented, verifyMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.sql.PreparedStatement
executeLargeUpdate, getParameterMetaData, setAsciiStream, setAsciiStream, setBinaryStream, setBinaryStream, setBlob, setBlob, setCharacterStream, setCharacterStream, setClob, setClob, setNCharacterStream, setNCharacterStream, setNClob, setNClob, setNClob, setNString, setObject, setObject, setRowId, setSQLXML, setURLMethods inherited from interface java.sql.Statement
addBatch, cancel, clearBatch, clearWarnings, close, closeOnCompletion, enquoteIdentifier, enquoteLiteral, enquoteNCharLiteral, execute, execute, execute, execute, executeBatch, executeLargeBatch, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, executeQuery, executeUpdate, executeUpdate, executeUpdate, executeUpdate, getConnection, getFetchDirection, getFetchSize, getGeneratedKeys, getLargeMaxRows, getLargeUpdateCount, getMaxFieldSize, getMaxRows, getMoreResults, getMoreResults, getQueryTimeout, getResultSet, getResultSetConcurrency, getResultSetHoldability, getResultSetType, getUpdateCount, getWarnings, isClosed, isCloseOnCompletion, isPoolable, isSimpleIdentifier, setCursorName, setEscapeProcessing, setFetchDirection, setFetchSize, setLargeMaxRows, setMaxFieldSize, setMaxRows, setPoolable, setQueryTimeoutMethods inherited from interface java.sql.Wrapper
isWrapperFor, unwrap
-
Constructor Details
-
MockPreparedStatement
public MockPreparedStatement()
-
-
Method Details
-
addResultSet
public void addResultSet(com.mockobjects.sql.MockResultSet aResultSet) -
addExpectedSetParameter
public void addExpectedSetParameter(int parameterIndex, int intValue) -
addExpectedSetParameter
-
addExpectedSetParameters
-
addExpectedTargetSQLType
public void addExpectedTargetSQLType(int aTargetSQLType) -
setExpectedClearParametersCalls
public void setExpectedClearParametersCalls(int callCount) -
setExpectingNoSetParameters
public void setExpectingNoSetParameters() -
clearParameters
- Specified by:
clearParametersin interfacePreparedStatement- Throws:
SQLException
-
execute
Calls innerExecute() (see CommonMockStatement). Returns false.- Specified by:
executein interfacePreparedStatement- Throws:
SQLException
-
executeQuery
Returns executeQuery(String) with an empty String.- Specified by:
executeQueryin interfacePreparedStatement- Throws:
SQLException
-
addUpdateCount
public void addUpdateCount(int count) Added value to be returned by executeUpdate()- Parameters:
count-- See Also:
-
executeUpdate
Returns value set with addUpdateCount- Specified by:
executeUpdatein interfacePreparedStatement- Throws:
SQLException- See Also:
-
setInt
- Specified by:
setIntin interfacePreparedStatement- Throws:
SQLException
-
setString
- Specified by:
setStringin interfacePreparedStatement- Throws:
SQLException
-
setTimestamp
- Specified by:
setTimestampin interfacePreparedStatement- Throws:
SQLException
-
setClob
- Specified by:
setClobin interfacePreparedStatement- Throws:
SQLException
-
setLong
- Specified by:
setLongin interfacePreparedStatement- Throws:
SQLException
-
setNull
- Specified by:
setNullin interfacePreparedStatement- Throws:
SQLException
-
setArray
- Specified by:
setArrayin interfacePreparedStatement- Throws:
SQLException
-
setShort
- Specified by:
setShortin interfacePreparedStatement- Throws:
SQLException
-
setTime
- Specified by:
setTimein interfacePreparedStatement- Throws:
SQLException
-
setObject
- Specified by:
setObjectin interfacePreparedStatement- Throws:
SQLException
-
setRef
- Specified by:
setRefin interfacePreparedStatement- Throws:
SQLException
-
setDate
- Specified by:
setDatein interfacePreparedStatement- Throws:
SQLException
-
setFloat
- Specified by:
setFloatin interfacePreparedStatement- Throws:
SQLException
-
setBlob
- Specified by:
setBlobin interfacePreparedStatement- Throws:
SQLException
-
setDate
- Specified by:
setDatein interfacePreparedStatement- Throws:
SQLException
-
setBytes
- Specified by:
setBytesin interfacePreparedStatement- Throws:
SQLException
-
setObject
- Specified by:
setObjectin interfacePreparedStatement- Throws:
SQLException
-
setByte
- Specified by:
setBytein interfacePreparedStatement- Throws:
SQLException
-
setDouble
- Specified by:
setDoublein interfacePreparedStatement- Throws:
SQLException
-
setTime
- Specified by:
setTimein interfacePreparedStatement- Throws:
SQLException
-
setBoolean
- Specified by:
setBooleanin interfacePreparedStatement- Throws:
SQLException
-
setBigDecimal
- Specified by:
setBigDecimalin interfacePreparedStatement- Throws:
SQLException
-
addBatch
Calls notImplemented.- Specified by:
addBatchin interfacePreparedStatement- Throws:
SQLException
-
setObject
Calls notImplemented.- Specified by:
setObjectin interfacePreparedStatement- Throws:
SQLException
-
setCharacterStream
Calls notImplemented.- Specified by:
setCharacterStreamin interfacePreparedStatement- Throws:
SQLException
-
setAsciiStream
Calls notImplemented.- Specified by:
setAsciiStreamin interfacePreparedStatement- Throws:
SQLException
-
setBinaryStream
Calls notImplemented.- Specified by:
setBinaryStreamin interfacePreparedStatement- Throws:
SQLException
-
setNull
Calls notImplemented.- Specified by:
setNullin interfacePreparedStatement- Throws:
SQLException
-
setUnicodeStream
Calls notImplemented.- Specified by:
setUnicodeStreamin interfacePreparedStatement- Throws:
SQLException
-
getMetaData
Calls notImplemented. Returns null.- Specified by:
getMetaDatain interfacePreparedStatement- Throws:
SQLException
-
setTimestamp
Calls notImplemented.- Specified by:
setTimestampin interfacePreparedStatement- Throws:
SQLException
-
addExpectedExecuteQuery
-
addExpectedExecuteUpdate
-
addExpectedExecute
-
setExpectedCloseCalls
public void setExpectedCloseCalls(int callCount) -
setupConnection
-
setupThrowExceptionOnExecute
-
setupUpdateCount
public void setupUpdateCount(int updateCount) -
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceStatement- Throws:
SQLException
-
execute
- Specified by:
executein interfaceStatement- Throws:
SQLException
-
executeQuery
- Specified by:
executeQueryin interfaceStatement- Throws:
SQLException
-
executeUpdate
- Specified by:
executeUpdatein interfaceStatement- Throws:
SQLException
-
getMaxFieldSize
- Specified by:
getMaxFieldSizein interfaceStatement- Throws:
SQLException
-
setMaxFieldSize
- Specified by:
setMaxFieldSizein interfaceStatement- Throws:
SQLException
-
getMaxRows
- Specified by:
getMaxRowsin interfaceStatement- Throws:
SQLException
-
setMaxRows
- Specified by:
setMaxRowsin interfaceStatement- Throws:
SQLException
-
setEscapeProcessing
- Specified by:
setEscapeProcessingin interfaceStatement- Throws:
SQLException
-
getQueryTimeout
- Specified by:
getQueryTimeoutin interfaceStatement- Throws:
SQLException
-
setQueryTimeout
- Specified by:
setQueryTimeoutin interfaceStatement- Throws:
SQLException
-
cancel
- Specified by:
cancelin interfaceStatement- Throws:
SQLException
-
getWarnings
- Specified by:
getWarningsin interfaceStatement- Throws:
SQLException
-
clearWarnings
- Specified by:
clearWarningsin interfaceStatement- Throws:
SQLException
-
setCursorName
- Specified by:
setCursorNamein interfaceStatement- Throws:
SQLException
-
getResultSet
- Specified by:
getResultSetin interfaceStatement- Throws:
SQLException
-
getUpdateCount
- Specified by:
getUpdateCountin interfaceStatement- Throws:
SQLException
-
getMoreResults
- Specified by:
getMoreResultsin interfaceStatement- Throws:
SQLException
-
setFetchDirection
- Specified by:
setFetchDirectionin interfaceStatement- Throws:
SQLException
-
getFetchDirection
- Specified by:
getFetchDirectionin interfaceStatement- Throws:
SQLException
-
setFetchSize
- Specified by:
setFetchSizein interfaceStatement- Throws:
SQLException
-
getFetchSize
- Specified by:
getFetchSizein interfaceStatement- Throws:
SQLException
-
getResultSetConcurrency
- Specified by:
getResultSetConcurrencyin interfaceStatement- Throws:
SQLException
-
getResultSetType
- Specified by:
getResultSetTypein interfaceStatement- Throws:
SQLException
-
addBatch
- Specified by:
addBatchin interfaceStatement- Throws:
SQLException
-
clearBatch
- Specified by:
clearBatchin interfaceStatement- Throws:
SQLException
-
executeBatch
- Specified by:
executeBatchin interfaceStatement- Throws:
SQLException
-
getConnection
- Specified by:
getConnectionin interfaceStatement- Throws:
SQLException
-