|
JDBaccess API 1.0 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Procedure
Interface for procedure calls. It extends the interface Call.
Example: Procedure procedure = DAReader.getProcedure(t); ArrayList params = new ArrayList(); params.add(new Integer(4711)); ArrayList outputParamTypes = new ArrayList(); outputParamTypes.add("varchar"); outputParamTypes.add("numeric"); outputParamTypes.add("cursor"); outputParamTypes.add("cursor"); procedure.setProcedureName("prc_addSalaryPercent"); procedure.setModuleName("pkg_employee"); procedure.setParameters(params); procedure.setOutputParamTypes(outputParamTypes); ArrayList outputParams = (ArrayList) procedure.execute(); String success = (String) outputParams.get(0); // first result: employees before execution of procedure CallResult result1 = procedure.getResult(1); ArrayList elems1 = result1.getAllElements(); // second result: employees after execution of procedure CallResult result2 = procedure.getResult(2); ArrayList elems2 = result2.getAllElements(); // count of all updated rows of this procedure Long updateCount = procedure.getSize(); procedure.end();
Method Summary | |
---|---|
java.lang.Object |
execute()
Execute the procedure and return an ArrayList of all output paramaters or one ouput paramter as an object if only one output parameter exists the |
java.util.ArrayList |
getOutputParams()
Get the output parameters of the procedure. |
java.lang.String |
getProcedureName()
Get the name of the procedure. |
CallResult |
getResult(int resultPosition)
Procedures could have one or more call results (selection results). |
void |
setOutputParamTypes(java.util.ArrayList outputParamTypes)
Set the output parameter types of the procedure. |
void |
setProcedureName(java.lang.String procedureName)
Set the name of the procedure. |
Methods inherited from interface com.jdbaccess.da.Call |
---|
getModuleName, setModuleName, setReadLobsFull |
Methods inherited from interface com.jdbaccess.da.DataAccess |
---|
end, getName, getObjectType, getPackageName, getSize, getSql, setName, setObjectType, setPackageName, setParameters, setSql, toString |
Method Detail |
---|
java.lang.Object execute() throws ApplicationException
ApplicationException
java.util.ArrayList getOutputParams()
java.lang.String getProcedureName()
void setProcedureName(java.lang.String procedureName)
procedureName
- name of the procedure to set. e.g. prc_updateSalaryByIdvoid setOutputParamTypes(java.util.ArrayList outputParamTypes)
outputParamTypes
- The output parameter types as an ArrayList. They have to
be in the same order than definded in the database system procedure.
In Oracle a special type "Cursor" has to be set if the database procedure defines
a "ref cursor" as an output parameter. In MySql this is not necessary.CallResult getResult(int resultPosition) throws ApplicationException
resultPosition
-
ApplicationException
|
JDBaccess API 1.0 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |