大家好我正在使用spring简单的JDBC模板来调用oracle函数
功能如下:
CREATE OR REPLACE FUNCTION RADON_DBA.Dbf_Verify_Address_Wrapper(P_Addr1 VARCHAR2,
P_Addr2 VARCHAR2,
P_City VARCHAR2,
P_State VARCHAR2,
P_Zip_Code VARCHAR2,
P_App_Identifier VARCHAR2) RETURN NUMBER IS
BEGIN
RETURN (radon_dba.Dbf_Verify_Address(radon_dba.address_t(P_Addr1,P_Addr2,P_City,P_State,P_Zip_Code,P_App_Identifier)));
END;
我的dao类如下
public Integer fetchVerifiedId(Address address, String vSource) {
SimpleJdbcCall getVerifiedId =new SimpleJdbcCall(jdbcTemplate).withCatalogName("RADON_DBA")
.withFunctionName("Dbf_Verify_Address_Wrapper").withoutProcedureColumnMetaDataAccess();
SqlParameterSource parMap =new MapSqlParameterSource().addValue("P_Addr1", address.getAddressLine1())
.addValue("P_Addr2", address.getAddressLine2())
.addValue("P_App_Identifier",vSource)
.addValue("P_City",address.getCity())
.addValue("P_State",address.getState())
.addValue("P_Zip_Code",address.getZip());
Integer verified_id = getVerifiedId.executeFunction(Integer.class, parMap);
return verified_id;
}
当我执行时我得到以下错误
Exception: CallableStatementCallback; uncategorized SQLException for SQL [{? = call RADON_DBA.DBF_VERIFY_ADDRESS_WRAPPER()}]; SQL state [99999]; error code [17041]; Missing IN or OUT parameter at index:: 1; nested exception is java.sql.SQLException: Missing IN or OUT parameter at index:: 1.