aspose file tools*
The moose likes Servlets and the fly likes 9/5/06  How to retrieve array elements returned by an Oracle SP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "9/5/06  How to retrieve array elements returned by an Oracle SP " Watch "9/5/06  How to retrieve array elements returned by an Oracle SP " New topic
Author

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

Raj
Greenhorn

Joined: Feb 21, 2006
Posts: 5
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 + "'" );
}


Raj
Joanne Neal
Rancher

Joined: Aug 05, 2005
Posts: 3739
    
  16
Don't post the same question in multiple forums.


Joanne
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: 9/5/06 How to retrieve array elements returned by an Oracle SP