I have complex procedures in oracle package with complex in/out parameters. I will show one of the my procedures in following :
PROCEDURE Authorize(PO_ErrorCode OUT NUMBER,
PO_ErrorText OUT VARCHAR2,
PI_Count IN NUMBER,
PI_Setting IN Setting,
PI_InputData IN InputData,
PO_PreData OUT InputData);
and will show two structures Setting and InputData in following:
CREATE OR REPLACE TYPE Setting as object( ProviderType NUMBER
SwitchCode NUMBER)
CREATE OR REPLACE TYPE Input_Data Is Table Of MainInputData;
CREATE OR REPLACE TYPE MainInputData as object( itemId NUMBER,
itemValue NVARCHAR2(150),
itemEncyptd NUMBER,
itemEncryptKey RAW(16));
with above description I have several structure contain : Type, Array, Array of Type and Array of Primitive.
I call this function by jdbc and oracle driver and related classes such as STRUCT& ARRAY but generated a lot of and complex code for this goal.
My question is : Is there utility or framework for do this task by simple code?
I know spring has a jdbc utility but I haven’t experience with it.
You can use spring utility.
There is a class
StoredProcedurewhere can you declare all your input and output parameters and their types inside the constructor usingsqlOutParameterandsqlInParameter.In your case there are 3 input parameters, to pass this you can overwrite
executemethod with 3 arguments and callsuper.execute(a,b,c)This link will be helpful.