hi i am unable to sort out an error in my code as below:
Array arr = cstmt.getArray(3);
rs = arr.getResultSet();
while (rs.next())
{
STRUCT struct = (STRUCT)rs.getObject(2);
Object[] cols = struct.getAttributes();
// Store the result set data
Object[] row = cols.clone();
for (int i = 0; i < row.length; i++)
{
if(i!=1&&i!=2&&i!=9&&i!=10)
{
List<Object[]> innerList =new ArrayList<Object[]>();
Array innerArray = (Array)row[i];
try
{
ResultSet rs1 = innerArray.getResultSet();
while (rs1.next())
{
STRUCT innerStruct = (STRUCT)rs1.getObject(2);
Object[] innerCols = innerStruct.getAttributes();
Object[] innerRow = innerCols.clone();
for (int j = 0; j < innerRow.length; j++)
{
if (innerRow[j] == null)
innerRow[j] = "";
}
innerList.add(innerRow);
}
if(rs1 != null)
{
rs1.close();
rs1 =null;
}
}catch(NullPointerException e)
{
logger.info("Exception in inner array in EMLGenerator"+e.getStackTrace());
}
row[i] = innerList;
}
else
{
if (row[i] == null) row[i] = "";
}
}
complexData.add(row);
}//end of while
}//end of else
}catch(NullPointerException e)
{
System.out.println("Excetipn NULL Pointer"+e.getStackTrace());
}
finally
{
if (cstmt != null) cstmt.close();
if (rs != null) rs.close();
}
}
error is in line Array innerArray = (Array)row[i]; where it is giving a type casting error of string to array..
please help..
your valuable thoughts are welcomed..