- This topic has 2 replies, 2 voices, and was last updated 12 years, 9 months ago by
julio.salazar.
-
AuthorPosts
-
julio.salazarMemberHi,
I want to reuse some of the functions that skyway already has for calling Oracle procedures and functions, but I didn’t found any documentation or examples of how I can accomplish this task with the spring mvc scafolding and the skyway-spring-utils-7.1.3.
Thanks in advance,
cconwayMemberHi Julio,
Can you please elaborate on n the “functions Skyway already has for calling Oracle procedures and functions”? I’m not aware of the functions you are speaking of but would be happy to help once I better understand the question.
julio.salazarMemberHi 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.jarorg.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);
-
AuthorPosts