wood burning stoves 2.0*
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 | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
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://aspose.com/file-tools
 
subject: how to get the result from oracle procedure it is returning refcursor
 
Similar Threads
Ibatis to pull values from dual defined in stored proc
iBatis Stored Procedure call
IBATIS - multiple parameter
Error in updating a table in mysql using IBATIS
jdbctype for enum in parameterMap's parameter in IBATIS