MyEclipse Forums
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
julio.salazar
Post subject: Callable statements Oracle (skyway-spring-utils-7.1.3)  PostPosted: May 01, 2012 - 12:15 AM
Registered Member
Registered Member


Joined: Mar 07, 2012
Posts: 8

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,
 
 View user's profile Send private message  
Reply with quote Back to top
cconway
Post subject:   PostPosted: May 03, 2012 - 01:00 AM



Joined: Apr 04, 2011
Posts: 196

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.

_________________
Cindy
MyEclipse for Spring Support
 
 View user's profile Send private message Send e-mail  
Reply with quote Back to top
julio.salazar
Post subject: solution found  PostPosted: May 03, 2012 - 04:41 PM
Registered Member
Registered Member


Joined: Mar 07, 2012
Posts: 8

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


Code:

--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);

 
 View user's profile Send private message  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT - 6 Hours
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2004 The PNphpBB Group
Credits