1. Use the following method to call all in-type parameter Processes (the ibatis version is 2.3)
For example:
Procedure flashback_op (v_table_owner varchar2, v_table_namevarchar2, v_flashbackscn number, v_xid varchar2, v_dbid number );
Call method:
<Parametermap id = "tabledml_recycle" class = "Java. util. Map">
<Parameter property = "owner" jdbctype = "varchar"
Javatype = "Java. Lang. String" mode = "in"/>
<Parameterproperty = "name" jdbctype = "varchar"
Javatype = "Java. Lang. String" mode = "in"/>
<Parameter property = "SCN" jdbctype = "Number"
Javatype = "Java. Math. bigdecimal" mode = "in"/>
<Parameterproperty = "dbid" jdbctype = "Number"
Javatype = "Java. Math. bigdecimal" mode = "in"/>
</Parametermap>
<Procedure id = "tabledml_zcrecycle" parametermap = "tabledml_recycle">
{Calltassetrec. flashback_op (?,?,?,?,?)}
</Procedure>
2. For a function whose return type is cursor (out), use the following method.
Function: function getfirstpagenumrows (v_where varchar2, v_dbidnumber, v_numrows varchar2, v_queryid varchar2) returnsys_refcursor;
Call method:
<Parametermap id = "searchparam" class = "Java. util. Map">
<Parameter property = "result" jdbctype = "oraclecursor" javatype = "Java. SQL. resultset" mode = "out" resultmap = "auditselect_resultlist"/>
<Parameter property = "IPaddress"
Jdbctype = "varchar" javatype = "Java. Lang. String" mode = "in"/>
<Parameter property = "dbid" jdbctype = "Number"
Javatype = "Java. Math. bigdecimal" mode = "in"/>
<Parameter property = "countnumber" jdbctype = "Number"
Javatype = "Java. Lang. Integer" mode = "in"/>
<Parameter property = "clientid" jdbctype = "varchar2"
Javatype = "Java. Lang. String" mode = "in"/>
</Parametermap>
<Procedure id = "firstpage" parametermap = "searchparam">
{? = Calltlgadmin. getfirstpagenumrows (?,?,?,?)} (Note that the return value is used before? Representative)
</Procedure>
Java code has the following values:
@ Suppresswarnings ("unchecked ")
Public listgetauditselectbypages (MAP map ){
Getsqlmapclienttemplate (). queryforlist ("firstpage", MAP); // call
Listarrylist = (arraylist) map. Get ("result"); // Value
Returnarrylist;
}
3. For functions whose return values are of the normal data type:
Function:
Function deletecommand (v_commandid number, v_commandsetidnumber default 0, v_dbid number default 0) returnnumber;
Use the following method for processing (when the return value is used as a parameter to process out ):
<Parametermap id = "commanddeletebyid" class = "Java. util. Map">
<Parameter property = "result" jdbctype = "varchar"
Javatype = "Java. Lang. String" mode = "out"/>
<Parameter property = "commandid" jdbctype = "Number"
Javatype = "Java. Lang. Integer" mode = "in"/>
<Parameter property = "commandsetid" jdbctype = "Number"
Javatype = "Java. Lang. Integer" mode = "in"/>
<Parameter property = "dbid" jdbctype = "Number"
Javatype = "Java. Math. bigdecimal" mode = "in"/>
</Parametermap>
<Procedure id = "command_deletebyid"
Parametermap = "commanddeletebyid">
{? = Call truleadmin. deletecommand (?,?,?)}
</Procedure>
Java code
This. getsqlmapclienttemplate (). Delete ("command_deletebyid", MAP );
String num = (string) map. Get ("result ");
Returnnum;
The call method is as follows:
Public String judgeidentity (string employeeno ){
Map map = new hashmap ();
Map. Put ("usercode", employeeno );
This. defaultibaitsdao. queryforobject ("storageout. getprocedure", MAP );
Return (string) map. Get ("cresult ");
}
Usercode is the property value of mode = "in" in parameter in the ibatis configuration file.
Cresult is the property value of mode = "out" in parameter in the ibatis configuration file.