33343536373839
protected int maxRows; public MockStatement(String method, MockDataSource mockDataSource, String sql) { this.sql = sql; this.mds = mockDataSource; MockDataSource.record(new ExecuteInfo(this.mds, method, null, null)); }
38394041424344
MockDataSource.record(new ExecuteInfo(this.mds, method, null, null)); } public MockStatement(String method, MockDataSource mockDataSource) { this.mds = mockDataSource; MockDataSource.record(new ExecuteInfo(this.mds, method, null, null)); }
8283848586878889
public boolean execute(String sql) throws SQLException { mds.checkState(); this.sql = sql; executeSqlInvokingTimes++; logger.warn("[execute(String)]" + sql); MockDataSource.record(new ExecuteInfo(this.mds, "execute", this.sql, null)); return success; }
9192939495969798
public boolean execute(String sql, int autoGeneratedKeys) throws SQLException { mds.checkState(); this.sql = sql; executeSqlInvokingTimes++; logger.warn("[execute(String,int)]" + sql); MockDataSource.record(new ExecuteInfo(this.mds, "execute_sql_int", this.sql, null)); return success; }
129130131132133134135136
public int[] executeBatch() throws SQLException { mds.checkState(); logger.warn("[executeBatch]" + sql); //throw new NotSupportException(""); MockDataSource.record(new ExecuteInfo(this.mds, "executeBatch", this.sql, null)); return new int[] { -1, -1 }; }
145146147148149150151152153
Thread.sleep(insertSleepTime); } catch (InterruptedException e) { e.printStackTrace(); } this.sql = sql; MockDataSource.record(new ExecuteInfo(this.mds, method, this.sql, null)); logger.warn("[UpdateHandler]" + sql); return MockDataSource.popPreAffectedRow(); }
43444546474849
throw new NotSupportException(""); } public MockConnection(String method, MockDataSource mockDataSource) { this.mockDataSource = mockDataSource; MockDataSource.record(new ExecuteInfo(this.mockDataSource, method, null, null)); }
6364656667686970
} public void commit() throws SQLException { mockDataSource.checkState(); checkClose(); MockDataSource.record(new ExecuteInfo(mockDataSource, "commit", null, null)); commitInvokingTimes++; }
210211212213214215216217
private int rollbackInvotingTimes = 0; public void rollback() throws SQLException { mockDataSource.checkState(); checkClose(); MockDataSource.record(new ExecuteInfo(mockDataSource, "rollback", null, null)); rollbackInvotingTimes++; }
217218219220221222223224225
} public void rollback(Savepoint savepoint) throws SQLException { mockDataSource.checkState(); checkClose(); MockDataSource.record(new ExecuteInfo(mockDataSource, "rollback#savepoint", null, new Object[]{ savepoint })); rollbackInvotingTimes++; }