Frühjahr SimpleJdbcCall Standard (optionale) Argumente

Ich versuche eine gespeicherte Prozedur aufrufen, die standardmäßig (optional) ohne Argumente übergeben, und es funktioniert nicht. Im wesentlichen das gleiche problem wie beschrieben hier.

Mein code:

  SqlParameterSource in = new MapSqlParameterSource()
        .addValue("ownname", "USER")
        .addValue("tabname", cachedTableName)
        .addValue("estimate_percent", 20)
        .addValue("method_opt", "FOR ALL COLUMNS SIZE 1")
        .addValue("degree", 0)
        .addValue("granularity", "AUTO")
        .addValue("cascade", Boolean.TRUE)
        .addValue("no_invalidate", Boolean.FALSE)
        .addValue("force", Boolean.FALSE);

Und ich bekomme eine exception:

Caused by: org.springframework.dao.InvalidDataAccessApiUsageException: Required input parameter 'PARTNAME' is missing
    at org.springframework.jdbc.core.CallableStatementCreatorFactory$CallableStatementCreatorImpl.createCallableStatement(CallableStatementCreatorFactory.java:209)

Wo PARTNAME " ist ein optionaler parameter gemäß diese. Auch durch die Tatsache bestätigt, dass ich diese Prozedur auszuführen, w/o wird die PARTNAME-argument manuell.

InformationsquelleAutor MK. | 2012-10-31
Schreibe einen Kommentar