• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

Java stored procedures and collections(ORCL)  RSS feed

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ?
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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);
while(rs.hasnext()){
// construct VO here
}
.
.
.
Hope it helps,
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!