Win a copy of Head First Android this week in the Android forum!
  • 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:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

Problems in fetching ref cursor.

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi

I am exeuting a Oracle stored proc which returns ref cursor. I have copule of problems with this.

1. Adter executing the proc..fetching the oupput from cursor is taking more time ..sometimes neary 1.5 hrs. Proc returns bulk data.Is there any way to make it fast.

My code is like this.

rs = ((OracleCallableStatement)cs).getCursor(2);
while(rs.next()){
//statements to get column values.

}

Is the above code causing slow fetch??

2. Before executing the proc, ie; after getting connection to Oracle DB after some time i get java.io.StreamCorruptedException: invalid stream header exception.

Can any one please help on this.
 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The java.io.StreamCorruptedException is caused by trying to read data that was not written with an ObjectOutputStream. ObjectInputStream isn't some magical thing that turns ordinary data into Java objects. You have to write an object to read an object. Have a look at The Java Tutorial on Serialization for more. As for your other question, let's move this topic to the JDBC forum.
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic