@Test public void testInvalidUpdate() throws Exception { final int res = this.dbOperator.update("update blah set ? = ?", "3", 26); Assert.assertEquals(0, res); }
public int update(final String updateClause, final Object... params) throws SQLException { try { return this.queryRunner.update(updateClause, params); } catch (final SQLException ex) { logger.error("update failed", ex); if (this.dbMetrics != null) { this.dbMetrics.markDBFailUpdate(); } throw ex; } }
DatabaseOperator { public int update(final String updateClause, final Object... params) throws SQLException { try { return this.queryRunner.update(updateClause, params); } catch (final SQLException ex) { logger.error("update failed", ex); if (this.dbMetrics != null) { this.dbMetrics.markDBFailUpdate(); } throw ex; } } }
DatabaseOperator { public int update(final String updateClause, final Object... params) throws SQLException { try { return this.queryRunner.update(updateClause, params); } catch (final SQLException ex) { logger.error("update failed", ex); if (this.dbMetrics != null) { this.dbMetrics.markDBFailUpdate(); } throw ex; } } @Inject  DatabaseOperator(final QueryRunner queryRunner); }
DatabaseOperator { public int update(final String updateClause, final Object... params) throws SQLException { try { return this.queryRunner.update(updateClause, params); } catch (final SQLException ex) { logger.error("update failed", ex); if (this.dbMetrics != null) { this.dbMetrics.markDBFailUpdate(); } throw ex; } } @Inject  DatabaseOperator(final QueryRunner queryRunner); T query(final String baseQuery, final ResultSetHandler<T> resultHandler,
      final Object... params); T query(final String baseQuery, final ResultSetHandler<T> resultHandler); T transaction(final SQLTransaction<T> operations); int update(final String updateClause, final Object... params); AzkabanDataSource getDataSource(); }
DatabaseOperator { public int update(final String updateClause, final Object... params) throws SQLException { try { return this.queryRunner.update(updateClause, params); } catch (final SQLException ex) { logger.error("update failed", ex); if (this.dbMetrics != null) { this.dbMetrics.markDBFailUpdate(); } throw ex; } } @Inject  DatabaseOperator(final QueryRunner queryRunner); T query(final String baseQuery, final ResultSetHandler<T> resultHandler,
      final Object... params); T query(final String baseQuery, final ResultSetHandler<T> resultHandler); T transaction(final SQLTransaction<T> operations); int update(final String updateClause, final Object... params); AzkabanDataSource getDataSource();  }