Example usage for org.springframework.jdbc.core.simple SimpleJdbcCall addDeclaredParameter

List of usage examples for org.springframework.jdbc.core.simple SimpleJdbcCall addDeclaredParameter

Introduction

In this page you can find the example usage for org.springframework.jdbc.core.simple SimpleJdbcCall addDeclaredParameter.

Prototype

public void addDeclaredParameter(SqlParameter parameter) 

Source Link

Document

Add a declared parameter to the list of parameters for the call.

Usage

From source file:org.springframework.jdbc.core.simple.SimpleJdbcCallTests.java

public void testUnnamedParameterHandling() throws Exception {
    final String MY_PROC = "my_proc";

    replay();/* w w  w. j av  a 2s.com*/

    SimpleJdbcCall sproc = new SimpleJdbcCall(mockDataSource).withProcedureName(MY_PROC);
    try {
        sproc.addDeclaredParameter(new SqlParameter(1));
        fail("Shouldn't succeed in adding unnamed parameter");
    } catch (InvalidDataAccessApiUsageException ex) {
        // OK
    }
}