4

I have the following parameters list in my stored procedure:

@ContractAgreement VARCHAR(100) = '1 Month',
@val1 VARCHAR,
@val2 VARCHAR

I have the following SimpleJdbcCall configuration:

SimpleJdbcCall jdbcCall = new SimpleJdbcCall(dataSource)
    .withProcedureName(getProcedureName())
    .returningResultSet(RESULT_SET, rowMapper)
    .useInParameterNames("val1", "val2");

final MapSqlParameterSource param = new MapSqlParameterSource();
    param.addValue("val1", "test1").addValue("val2", "test2");

jdbcCall.execute(param)

This results in the following error:

com.microsoft.sqlserver.jdbc.SQLServerException: Procedure or function 'njtest' expects parameter '@val2', which was not supplied.

But if I remove the "@ContractAgreement" in parameter from the stored procedure it works fine.

Any suggestions please?

Osramadus
  • 43
  • 4

0 Answers0