In the database are three Oracle custom types (simplified) as follows:
create or replace TYPE T_ENCLOSURE AS OBJECT(
ENCLOSURE_ID NUMBER(32,0),
ENCLOSUR
I Just share the logic which worked for me. You can try this to retrieve ARRAY response from PL/SQL to Java.
CallableStatement callstmt = jdbcConnection.prepareCall("{call PROCEDURE_NAME(?, ?)}");
callstmt.setArray(1, array);
callstmt.registerOutParameter(2,Types.ARRAY, );
// Do all execute operations
Array arr = callstmt.getArray(1);
if (arr != null) {
Object[] data = (Object[]) arr.getArray();
for (Object a : data) {
OracleStruct empstruct = (OracleStruct) a;
Object[] objarr = empstruct.getAttributes();
r = new (objarr[0].toString(), objarr[1].toString());
System.out.println("Response-> : "+ r.toString());
}
}