时间:2021-07-01 10:21:17 帮助过:3人阅读
publicclassHelloWorld{
publicstaticvoid testFunc(int a,int b,String[] tst,int[] bigger){
if(a > b)
bigger[0]= a;
else
bigger[0]= b;
tst[0]="The bigger one is: ";
}
}
>>?SECTION "CREATE ENDER SPJs"
>>CREATE PROCEDURE sos.ecui.testFunc(IN param_a INT, IN param_b INT, OUT tst VARCHAR(20), OUT bigger INT)
+>EXTERNAL NAME ‘HelloWorld.testFunc‘
+>EXTERNAL PATH ‘/home/ecui/java/test‘
+>LANGUAGE JAVA
+>PARAMETER STYLE JAVA
+>MODIFIES SQL DATA;
--- SQL operation complete.
>> SHOWDDL SOS.ECUI.TESTFUNC;
CREATE PROCEDURE SOS.ECUI.TESTFUNC
(
IN PARAM_A INTEGER
, IN PARAM_B INTEGER
, OUT TST VARCHAR(20) CHARACTER SET ISO88591
, OUT BIGGER INTEGER
)
EXTERNAL NAME ‘HelloWorld.testFunc (int,int,java.lang.String[],int[])‘
EXTERNAL PATH ‘/home/ecui/java/test‘
LOCATION \P3DEV.$DATA01.ZSDZSGJ5.MKN46G00
LANGUAGE JAVA
PARAMETER STYLE JAVA
MODIFIES SQL DATA
DYNAMIC RESULT SETS 0
NOT DETERMINISTIC
ISOLATE
;
--- SQL operation complete.
>>CALL sos.ecui.testFunc(2,4,?,?);
TST BIGGER
-------------------- -----------
The bigger one is: 4
--- SQL operation complete.
>>CALL sos.ecui.testFunc(20,4,?,?);
TST BIGGER
-------------------- -----------
The bigger one is: 20
--- SQL operation complete.
>>DROP procedure SOS.ECUI.TESTFUNC;
--- SQL operation complete.
HP Nonstop SQLMX (SPJ) Stored Procedure in Javas Getting Started
标签: