• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.........
 
Greenhorn
Posts: 22
Eclipse IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic