DatabaseConnection connection = createMock(DatabaseConnection.class);
@SuppressWarnings("unchecked")
PreparedUpdate<Foo> update = createMock(PreparedUpdate.class);
CompiledStatement compiledStmt = createMock(CompiledStatement.class);
expect(update.compile(connection, StatementType.UPDATE)).andReturn(compiledStmt);
expect(compiledStmt.runUpdate()).andThrow(new SQLException("expected"));
compiledStmt.close();
StatementExecutor<Foo, String> statementExec =
new StatementExecutor<Foo, String>(databaseType, tableInfo, null);
replay(connection, compiledStmt, update);
try {