Stack Exchange
SimpleJDBCCall class parameter passing
I have a stored procedure in y db which is on MYSQL server. And when I try to call it, it gives the error:

com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Incorrect
  number of arguments for PROCEDURE thu.productGetter; expected 2, got 0
    at
  org.springframework.jdbc.support.SQLExceptionSubclassTranslator.doTranslate(SQLExceptionSubclassTranslator.java:95)
    at
  org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:73)
    at
  org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:81)
    at
  org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:1137)
    at
  org.springframework.jdbc.core.JdbcTemplate.call(JdbcTemplate.java:1173)
    at
  org.springframework.jdbc.core.simple.AbstractJdbcCall.executeCallInternal(AbstractJdbcCall.java:378)
    at
  org.springframework.jdbc.core.simple.AbstractJdbcCall.doExecute(AbstractJdbcCall.java:363)

Java code is:   
SimpleJdbcCall jdbcCall = new SimpleJdbcCall(getJdbcTemplate())
                                    .withSchemaName("thu")
                                    .withProcedureName("productGetter");

    jdbcCall.addDeclaredParameter(new SqlParameter("maxPrice", Types.DOUBLE));
    jdbcCall.addDeclaredParameter(new SqlParameter("minPrice", Types.DOUBLE));

    Map<String, Object> params=new HashMap<String, Object>();
    params.put("maxPrice", maxPrice);
    params.put("minPrice", minPrice);


    jdbcCall.execute(params);

And the stored procedure db code is:
CREATE DEFINER=`root`@`localhost` PROCEDURE `productGetter`(IN maxPrice double,minPrice double)
BEGIN
        ...    
END$$

I have checked plenty of examples and could not find any solution for my problem. 
Any ideas?

The error you are receiving is telling you that you have not passed enough parameters to it. Check to see if the params are getting set correctly in your params Map.

they are anf it actually says that it did not pass any parameter, not less.

Enable DEBUG logging and see in logs what parameters and what values are passed to the stored procedure. AbstractJdbcCall.executeCallInternal has this kind of logging.

definitely, I have looked at source code of jar and found that in the end the callparameters list is empty.

There would be the alternative jdbcCall.execute(maxPrice, minPrice); too.

I've experienced the same issue after upgrading from mysql 5.1 connector to 6.0.6 and the way to solve is just to add : .withoutProcedureColumnMetaDataAccess() in this way : 
SimpleJdbcCall jdbcCall = new SimpleJdbcCall(getJdbcTemplate())
                                    .withSchemaName("thu")
                                    .withProcedureName("productGetter")
                                    .withoutProcedureColumnMetaDataAccess();

    jdbcCall.addDeclaredParameter(new SqlParameter("maxPrice", Types.DOUBLE));
    jdbcCall.addDeclaredParameter(new SqlParameter("minPrice", Types.DOUBLE));

    Map<String, Object> params=new HashMap<String, Object>();
    params.put("maxPrice", maxPrice);
    params.put("minPrice", minPrice);


    jdbcCall.execute(params);


I had the same message about missing parameters but it turned out that it was the schema name that was wrong

You could try MapSqlParamterSorce instead.
SimpleJdbcCall jdbcCall = new SimpleJdbcCall(getJdbcTemplate())
                                    .withSchemaName("thu")
                                    .withProcedureName("productGetter")
                                    .withoutProcedureColumnMetaDataAccess();

jdbcCall.addDeclaredParameter(new SqlParameter("maxPrice", Types.DOUBLE));
jdbcCall.addDeclaredParameter(new SqlParameter("minPrice", Types.DOUBLE));

MapSqlParameterSource source = new MapSqlParameterSource();
source.addValue("maxPrice", maxPrice);
source.addValue("minPrice", minPrice);

jdbcCall.execute(source);

