Hi Cindy,
After some research and test I found that the below class has inheritance from SimpleJdbcCall (Spring jdbc core) and it seems to manage the execution of procedures and functions from the DB, in my particular case I’m using it on oracle 11g and I did the below implementation , maybe it will help someone in the near future. It will be nice to have some documented examples for an easier use.
skyway-sprint-utils-7.1.13.jar
org.springframework.jdbc.core.simple.SimpleJdbcCall
– org.skyway.spring.util.dao.call.MetaDataJdbcCall
– org.skyway.spring.util.dao.call.AdvancedMetaDataJdbcCall
--Procedure
AdvancedMetaDataJdbcCall caller = dataStore.getJdbcHelper();
caller.withProcedureName("pr_execute_dual");
caller.setFunction(false);
caller.addParameter(new SqlParameter("P_DUMMY", Types.NUMERIC));
caller.withCatalogName("PKG_TESTING");
SqlParameterSource in = new MapSqlParameterSource().addValue("P_DUMMY",
new BigDecimal(264));
caller.withSchemaName("TESTSCHEMA");
caller.execute(in);
-- Function
AdvancedMetaDataJdbcCall caller = dataStore.getJdbcHelper();
caller.withFunctionName("f_execute_dual");
caller.withCatalogName("PKG_TESTING");
caller.setFunction(true);
caller.addParameter(new SqlParameter(Types.NUMERIC));
caller.addParameter(new SqlParameter("P_DUMMY", Types.INTEGER));
caller.withSchemaName("TESTSCHEMA");
SqlParameterSource in = new MapSqlParameterSource().addValue("P_DUMMY",
473);
BigDecimal value = caller.executeFunction(BigDecimal.class, in);