Example usage for org.springframework.jdbc.core JdbcTemplate setSkipResultsProcessing

List of usage examples for org.springframework.jdbc.core JdbcTemplate setSkipResultsProcessing

Introduction

In this page you can find the example usage for org.springframework.jdbc.core JdbcTemplate setSkipResultsProcessing.

Prototype

public void setSkipResultsProcessing(boolean skipResultsProcessing) 

Source Link

Document

Set whether results processing should be skipped.

Usage

From source file:org.springframework.jdbc.object.StoredProcedureTests.java

public void testStoredProcedureSkippingResultsProcessing() throws Exception {
    mockCallable.execute();/*from  ww w .  j  av  a2  s.  co  m*/
    ctrlCallable.setReturnValue(true);
    mockCallable.getUpdateCount();
    ctrlCallable.setReturnValue(-1);
    if (debugEnabled) {
        mockCallable.getWarnings();
        ctrlCallable.setReturnValue(null);
    }
    mockCallable.close();
    ctrlCallable.setVoidCallable();

    mockConnection.prepareCall("{call " + StoredProcedureWithResultSetMapped.SQL + "()}");
    ctrlConnection.setReturnValue(mockCallable);

    replay();

    JdbcTemplate jdbcTemplate = new JdbcTemplate(mockDataSource);
    jdbcTemplate.setSkipResultsProcessing(true);
    StoredProcedureWithResultSetMapped sproc = new StoredProcedureWithResultSetMapped(jdbcTemplate);
    Map res = sproc.execute();

    assertEquals("incorrect number of returns", 0, res.size());
}