|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.mockrunner.mock.jdbc.MockStatement
com.mockrunner.mock.jdbc.MockPreparedStatement
net.sourceforge.sqlunit.test.mock.SQLUnitMockPreparedStatement
public class SQLUnitMockPreparedStatement
Overrides certain methods in the MockPreparedStatement class for mock testing of SQLUnit.
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 | |
---|---|
SQLUnitMockPreparedStatement(java.sql.Connection conn,
java.lang.String sql)
Instantiate a SQLUnitMockPreparedStatement object using a Connection object and a SQL string. |
Method Summary | |
---|---|
void |
addBatch()
Parses and replaces positional parameters in the SQL string and adds it to the batch for executeBatch() to pick up. |
boolean |
execute()
Invokes the named method on the MockDatabase using introspection. |
int[] |
executeBatch()
Runs the batch list against the IntrospectingResultSetFactory to return an array of update counts. |
boolean |
getMoreResults()
Returns true if there are more result sets available for this SQL. |
java.sql.ResultSet |
getResultSet()
Returns the current result set from the SQL statement. |
int |
getUpdateCount()
Returns the update count. |
void |
setObject(int index,
java.lang.Object obj,
int sqlType)
Sets an object into the parameter map. |
void |
setResultSetHandler(com.mockrunner.jdbc.AbstractResultSetHandler aHandler)
Sets the IntrospectingPreparedStatementResultSetHandler for the MockPreparedStatement. |
Methods inherited from class com.mockrunner.mock.jdbc.MockPreparedStatement |
---|
clearParameters, executeBatch, executeQuery, executeQuery, executeUpdate, executeUpdate, getIndexedParameterMap, getMetaData, getParameter, getParameterMetaData, getSQL, setArray, setAsciiStream, setBigDecimal, setBinaryStream, setBlob, setBoolean, setByte, setBytes, setCharacterStream, setClob, setDate, setDate, setDouble, setFloat, setInt, setLong, setNull, setNull, setObject, setObject, setPreparedStatementResultSetHandler, setRef, setShort, setString, setTime, setTime, setTimestamp, setTimestamp, setUnicodeStream, setURL |
Methods inherited from class com.mockrunner.mock.jdbc.MockStatement |
---|
addBatch, cancel, clearBatch, clearWarnings, cloneResultSet, close, execute, execute, execute, execute, executeQuery, executeUpdate, executeUpdate, executeUpdate, executeUpdate, getConnection, getCursorName, getFetchDirection, getFetchSize, getGeneratedKeys, getMaxFieldSize, getMaxRows, getMoreResults, getQueryTimeout, getResultSetConcurrency, getResultSetHoldability, getResultSetType, getWarnings, isClosed, isQuery, setCursorName, setEscapeProcessing, setFetchDirection, setFetchSize, setMaxFieldSize, setMaxRows, setNextResultSet, setNextUpdateCount, setQueryTimeout |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.sql.Statement |
---|
addBatch, cancel, clearBatch, clearWarnings, close, execute, execute, execute, execute, executeQuery, executeUpdate, executeUpdate, executeUpdate, executeUpdate, getConnection, getFetchDirection, getFetchSize, getGeneratedKeys, getMaxFieldSize, getMaxRows, getMoreResults, getQueryTimeout, getResultSetConcurrency, getResultSetHoldability, getResultSetType, getWarnings, setCursorName, setEscapeProcessing, setFetchDirection, setFetchSize, setMaxFieldSize, setMaxRows, setQueryTimeout |
Constructor Detail |
---|
public SQLUnitMockPreparedStatement(java.sql.Connection conn, java.lang.String sql)
conn
- the Connection object.sql
- the SQL string.Method Detail |
---|
public final void setResultSetHandler(com.mockrunner.jdbc.AbstractResultSetHandler aHandler)
setResultSetHandler
in class com.mockrunner.mock.jdbc.MockStatement
aHandler
- an IntrospectingPreparedStatementResultSetHandler object.public final boolean getMoreResults() throws java.sql.SQLException
getMoreResults
in interface java.sql.Statement
getMoreResults
in class com.mockrunner.mock.jdbc.MockStatement
java.sql.SQLException
- if one is thrown.public final java.sql.ResultSet getResultSet() throws java.sql.SQLException
getResultSet
in interface java.sql.Statement
getResultSet
in class com.mockrunner.mock.jdbc.MockStatement
java.sql.SQLException
- if one is thrown.public final boolean execute() throws java.sql.SQLException
execute
in interface java.sql.PreparedStatement
execute
in class com.mockrunner.mock.jdbc.MockPreparedStatement
java.sql.SQLException
- if there was a problem executing.public final int getUpdateCount() throws java.sql.SQLException
getUpdateCount
in interface java.sql.Statement
getUpdateCount
in class com.mockrunner.mock.jdbc.MockStatement
java.sql.SQLException
- if an error occurs.public final void setObject(int index, java.lang.Object obj, int sqlType) throws java.sql.SQLException
setObject
in interface java.sql.PreparedStatement
setObject
in class com.mockrunner.mock.jdbc.MockPreparedStatement
index
- the parameter index (1-based).obj
- the parameter Object.sqlType
- the SQL Type of the parameter.
java.sql.SQLException
- if an error occurs.public final void addBatch() throws java.sql.SQLException
addBatch
in interface java.sql.PreparedStatement
addBatch
in class com.mockrunner.mock.jdbc.MockPreparedStatement
java.sql.SQLException
- if there was a problem.public final int[] executeBatch() throws java.sql.SQLException
executeBatch
in interface java.sql.Statement
executeBatch
in class com.mockrunner.mock.jdbc.MockPreparedStatement
java.sql.SQLException
- if there was a problem.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |