1
votes

looks like jdbc template is not passing params to hana db while calling stored procedures. As per our analysis spring jdbc implementation is not identifying procedure params from metadata. .We are using standard code for calling proc.

simpleJdbcCall = new SimpleJdbcCall(datasource).withSchemaName(getSchemaString())
                        .withProcedureName(name);
                results = simpleJdbcCall.execute(params);

We tried searching net but coudnt find satisfactorily solution i have also tried setting paramerter explicity

simpleJdbcCall = new SimpleJdbcCall(datasource).withSchemaName(getSchemaString())
       .withProcedureName(name);
     SqlParameterSource in = new MapSqlParameterSource().addValues(params);

    results = simpleJdbcCall.execute(in);

here params is hashmap. Still issue remain same

1
i have tried adding params explicitly too.missed adding in post earlier.updated question. - Vish
i think i got it..can you please add same in answer - Vish

1 Answers

1
votes

From the javadoc (emphasis is mine):

The meta data processing is based on the DatabaseMetaData provided by the JDBC driver. Since we rely on the JDBC driver, this "auto-detection" can only be used for databases that are known to provide accurate meta data. These currently include Derby, MySQL, Microsoft SQL Server, Oracle, DB2, Sybase and PostgreSQL. For any other databases you are required to declare all parameters explicitly.

I would say you need to use SimpleJdbcCall#declareParameters(SqlParameter...)