facebook

Callable statements Oracle (skyway-spring-utils-7.1.3)

  1. MyEclipse IDE
  2.  > 
  3. Spring Development
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #325675 Reply

    Hi,

    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,

    #325762 Reply

    cconway
    Member

    Hi 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.

    #325786 Reply

    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);
    
    
Viewing 3 posts - 1 through 3 (of 3 total)
Reply To: Callable statements Oracle (skyway-spring-utils-7.1.3)

You must be logged in to post in the forum log in