【发布时间】:2012-10-21 03:40:27
【问题描述】:
我正在尝试调用具有默认(可选)参数而不传递它们的存储过程,但它不起作用。与here 描述的问题基本相同。
我的代码:
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);
我得到一个例外:
Caused by: org.springframework.dao.InvalidDataAccessApiUsageException: Required input parameter 'PARTNAME' is missing
at org.springframework.jdbc.core.CallableStatementCreatorFactory$CallableStatementCreatorImpl.createCallableStatement(CallableStatementCreatorFactory.java:209)
其中 PARTNAME 是根据this 的可选参数。也证实了我可以在没有 PARTNAME 参数的情况下手动运行此过程。
【问题讨论】:
-
第二个超链接显示 404 。
标签: java spring stored-procedures jdbc