Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Raj
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • 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 + "'" );
}
 
Joanne Neal
Rancher
Posts: 3742
16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Don't post the same question in multiple forums.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic