title: SimpleJdbcCall doesn't work for a stored function
body: <p>I am trying to execute a stored function on DB2 from Java. The function and code that calls it are very similar to those from Spring documentation's example <a href="https://docs.spring.io/spring/docs/current/spring-framework-reference/html/jdbc.html#jdbc-simple-jdbc-call-3" rel="nofollow noreferrer">https://docs.spring.io/spring/docs/current/spring-framework-reference/html/jdbc.html#jdbc-simple-jdbc-call-3</a>. Here's the function declaration: </p>
  
  <pre><code>CREATE FUNCTION ST_CLIENT_SEGMENT( p_oib VARCHAR(11) )
      RETURNS VARCHAR(10)
      NO EXTERNAL ACTION
  </code></pre>
  
  <p>Here's the code:</p>
  
  <pre><code>//version1
  SimpleJdbcCall simpleJdbcCall = new SimpleJdbcCall(jdbcTemplate)
      .withSchemaName("VLIB").
      .withFunctionName("ST_CLIENT_SEGMENT")
  SqlParameterSource in = new MapSqlParameterSource().addValue("p_oib", "123");
  return simpleJdbcCall.executeFunction(String.class, in);
  
  //version2
  SimpleJdbcCall simpleJdbcCall = new SimpleJdbcCall(jdbcTemplate)
      .withSchemaName("VLIB")
      .withFunctionName("ST_CLIENT_SEGMENT");
  simpleJdbcCall.declareParameters(new SqlParameter("p_oib", Types.VARCHAR));
  return simpleJdbcCall.executeFunction(String.class, "123");
  
  //the same exception
  //Caused by: java.sql.SQLException: [SQL0440] Routine ST_CLIENT_SEGMENT in VLIB not found with specified parameters.
  </code></pre>
  
  <p>Does anyone know why this happens? When I call the function from my SQL client everything works fine.</p>