• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

9/5/06 How to retrieve array elements returned by an Oracle SP

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have an Oracle SP that returns a Array.
Now, I am trying to retrieve the elements in that array using the following code snippet....but i am facing a java.lang.ClassCastException....
can somebody help me out with this???
i got this code from a tutorial......

cstmt1.registerOutParameter(4, OracleTypes.ARRAY,"PROPLIST");
cstmt1.executeUpdate();

ARRAY propValues = (ARRAY)cstmt1.getArray(4);

String[] values = (String[]) propValues.getArray();

for( int i = 0; i < values.length; i++ )
{
System.out.println( "row " + i + " = '" + values + "'" );
}
 
Rancher
Posts: 3742
16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Don't post the same question in multiple forums.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic