Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
venu babu.k
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 22
Eclipse IDE Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic