@Test public void testParameterApplicatorServiceException() throws Exception { doThrow(new SQLException("Expected")).when(mockStatement).setObject(anyInt(), anyString()); try { parameterApplicator.applyStatementParameters(message, mockStatement, parameters, twoParamSqlStatement); fail("Should throw service exception."); } catch (ServiceException ex) { } }
@Override public void applyStatementParameters(AdaptrisMessage message, PreparedStatement statement, StatementParameterCollection parameters, String originalSql) throws ServiceException { try { for (int i = 1; i <= parameters.size(); i++) { JdbcStatementParameter statementParameter = parameters.get(i - 1); statementParameter.apply(i, statement, message); } } catch (Exception ex) { throw ExceptionHelper.wrapServiceException(ex); } }
SequentialParameterApplicator implements ParameterApplicator { @Override public void applyStatementParameters(AdaptrisMessage message, PreparedStatement statement, StatementParameterCollection parameters, String originalSql) throws ServiceException { try { for (int i = 1; i <= parameters.size(); i++) { JdbcStatementParameter statementParameter = parameters.get(i - 1); statementParameter.apply(i, statement, message); } } catch (Exception ex) { throw ExceptionHelper.wrapServiceException(ex); } } }
SequentialParameterApplicator implements ParameterApplicator { @Override public void applyStatementParameters(AdaptrisMessage message, PreparedStatement statement, StatementParameterCollection parameters, String originalSql) throws ServiceException { try { for (int i = 1; i <= parameters.size(); i++) { JdbcStatementParameter statementParameter = parameters.get(i - 1); statementParameter.apply(i, statement, message); } } catch (Exception ex) { throw ExceptionHelper.wrapServiceException(ex); } }  }
SequentialParameterApplicator implements ParameterApplicator { @Override public void applyStatementParameters(AdaptrisMessage message, PreparedStatement statement, StatementParameterCollection parameters, String originalSql) throws ServiceException { try { for (int i = 1; i <= parameters.size(); i++) { JdbcStatementParameter statementParameter = parameters.get(i - 1); statementParameter.apply(i, statement, message); } } catch (Exception ex) { throw ExceptionHelper.wrapServiceException(ex); } }  @Override void applyStatementParameters(AdaptrisMessage message, PreparedStatement statement, StatementParameterCollection parameters, String originalSql); @Override String prepareParametersToStatement(String originalStatement); }
SequentialParameterApplicator implements ParameterApplicator { @Override public void applyStatementParameters(AdaptrisMessage message, PreparedStatement statement, StatementParameterCollection parameters, String originalSql) throws ServiceException { try { for (int i = 1; i <= parameters.size(); i++) { JdbcStatementParameter statementParameter = parameters.get(i - 1); statementParameter.apply(i, statement, message); } } catch (Exception ex) { throw ExceptionHelper.wrapServiceException(ex); } }  @Override void applyStatementParameters(AdaptrisMessage message, PreparedStatement statement, StatementParameterCollection parameters, String originalSql); @Override String prepareParametersToStatement(String originalStatement);  }