File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB and other Java EE Technologies and the fly likes how to get the result from oracle procedure it is returning refcursor Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Reply Bookmark "how to get the result from oracle procedure it is returning refcursor" Watch "how to get the result from oracle procedure it is returning refcursor" New topic
Author

how to get the result from oracle procedure it is returning refcursor

venu babu.k
Greenhorn

Joined: Nov 09, 2010
Posts: 8
Hi,

I need a help that how to retrive the data when we call a procedure with 2 input parameters and 1 output parameters.
Iam unable to get those data , iam getting null after calling the procedure.

PROCEDURE empinfo (
ename VARCHAR2,
eno NUMBER,
r_cursor OUT ref_cursor
)
----------------------------------------------------------------------------

Emp.xml file
-------------------------------------------------------------------


<parameterMap id="data" class="map" >
<parameter property="ename" jdbcType="VARCHAR" javaType="string" mode="IN"/>
<parameter property="eno" jdbcType="NUMERIC" javaType="int" mode="IN"/>
<parameter property="result" jdbcType="ORACLECURSOR" javaType="java.sql.ResultSet" mode="OUT"/>
</parameterMap>

<procedure id="info" parameterMap="data">
<![CDATA[
{call EMP_MONITOR_PKG.empinfo(?,?,?)}
]]>
</procedure>

EMP_MONITOR_PKG is the alias name.

-----------------------------------------------------------------------------


In java iam retrieving as fallows...
----------------------------------------------------------------------------------
HashMap<String, Object> param = new HashMap<String, Object>();
param.put("ename", ename);
param.put("eno", new Integer(eno);
getSqlMapClientTemplate().insert("Monitor.getBetTypeExposure", param);
rs = (ResultSet)param.get("result");
if (rs.next()) {
emp = new Employee();
bte.setSalary(rs.getInt("salary"));

---------------------------------------------------------------------------------




Thanks in advance.........
Victor Hugo M Machado
Greenhorn

Joined: Jan 11, 2011
Posts: 22

 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: how to get the result from oracle procedure it is returning refcursor
 
Similar Threads
IBATIS - multiple parameter
iBatis Stored Procedure call
jdbctype for enum in parameterMap's parameter in IBATIS
Ibatis to pull values from dual defined in stored proc
Error in updating a table in mysql using IBATIS