Dashboard > iBATIS DataMapper > 2005 > November > 28 > How do I use an Oracle Ref Cursor in java?
How do I use an Oracle Ref Cursor in java?
Added by zcjsh, last edited by zcjsh on Nov 28, 2005  (view change)
Labels: 
(None)

CREATE OR REPLACE PACKAGE "JAMES"."PKG_TEST" as
TYPE myrctype IS REF CURSOR;
end pkg_test;

CREATE OR REPLACE PROCEDURE "JAMES"."PRO_DKTPHOUSEPLANBACKTEST"
(
p_rc out pkg_test.myrctype
)
as

begin
open p_rc for select LOANMODEID,way,isvisible,isdelete from dkLOANMODE;
end;

<parameterMap id="swapParas" class="map">
<parameter property="p_rc" jdbcType="" javaType="" mode="OUT" />
</parameterMap>
<procedure id="PhouseLoan.queryTphousePlanBack" parameterMap="swapParas">

Unknown macro: {call PRO_DKTPHOUSEPLANBACKTEST(?)}

</procedure>

this pro_dkTphousePlanBack return cursor,

in .java
HashMap paraMap = new HashMap();
paraMap.put("p_rc", null);
queryForObject("PhouseLoan.queryTphousePlanBack",paraMap);
with Input parameter


Site running on a free Atlassian Confluence Open Source Project License granted to OSS. Evaluate Confluence today.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.5.5 Build:#811 Jul 25, 2007) - Bug/feature request - Contact Administrators