• 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
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

what is the equivalent data type for Oracle Cursor.

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I am using Oracle 8i as my BackEnd. I am using a Stored Procedure present in Oracle, which takes two IN parameter and one OUT parameter. Say the proc. will look something like this.
" testProc(intVar1 IN Integer,
strVar2 IN varchar,
cusrRec OUT curdsor_reference) "
Now how can I pass my OUT variable as a CURSOR to my Procedure when I call it in Javacode. What is the equivalent DataType for SQL Cursor in Java? How can i handle SQL Cursor in my Java Code?
Expecting for an immediate Reply.
Thanks in Advance.
Sridhar.


 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have the same problem !! Have you figured it out ?
 
Ranch Hand
Posts: 449
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
try this
testProc(intVar1 IN Integer,
strVar2 IN varchar,
cusrRec IN OUT curdsor_reference)

Make the curdsor_reference as IN and OUT parameter both.
And in Java use this code.
CallableStatement cstmt = con.prepareCall("{call testProc(?,?,?)}");
cstmt.setInt(1);
cstmt.setString(2);
cstmt.registerOutParameter(3, oracle.jdbc.OracleTypes.CURSOR);
cstmt.execute();
ResultSet result = (ResultSet) cstmt.getObject(3);

Vijay
 
They gave me pumpkin ice cream. It was not pumpkin pie ice cream. Wiping my tongue on this tiny ad:
Clean our rivers and oceans from home
https://www.kickstarter.com/projects/paulwheaton/willow-feeders
reply
    Bookmark Topic Watch Topic
  • New Topic