File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes Java stored procedures and collections(ORCL) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Java stored procedures and collections(ORCL)" Watch "Java stored procedures and collections(ORCL)" New topic

Java stored procedures and collections(ORCL)

Ricardo Riveros

Joined: Jan 31, 2007
Posts: 1
Hi all, i'm new to this forum and had a question.
I'm writing Java stored procedures for Oracle 10g and had a question.
Is there anyway a java stored procedure/function can return a collection that contains value objects that I created ?

Basically in the java stored procedure I want to execute the same query(with different parameters) inside a loop and create a collection of Value objects created from each ResultSet. How would I go about passing this back to the calling client ?
venkat vanukuri

Joined: Mar 12, 2005
Posts: 3
I think you can pass collection as an object to calling client from Stored procedure. Its possible with Oracle data type CURSOR. example:

callStmt.registerOutParameter(index number, OracleTypes.CURSOR);
ResultSet rs = callstmt.getObject(index number);
// construct VO here
Hope it helps,

Venky<br />SCJP 1.4,IBM 285
I agree. Here's the link:
subject: Java stored procedures and collections(ORCL)
It's not a secret anymore!