I followed this issue and sort of successfully sent Collection to Oracle database.
Unfortunately all my String values in Struct array become empty while packing them from Object into Struct.
Object[] reportArray = new Object[3];
Struct[] struct = new Struct[reports.size()];
int arrayIndex = 0;
for (Report data : reports) {
reportArray[0] = data.getXXX(); //data return String here and it become empty on createStruct
reportArray[1] = data.getYYY();
reportArray[2] = data.getZZZ();
struct[arrayIndex++] = connection.createStruct("R_REPORT_OBJECT", reportArray);
}
Array reportsArray = ((OracleConnection) connection).createOracleArray("T_REPORT_TABLE", struct);
callableStatement.setArray("T_REPORT_IN", reportsArray);
callableStatement.executeUpdate();
So if data getter(getXXX or getYYY or get ZZZ) return number then it’s okay.
But if getter return String then it gets sent as a null to database. I have checked datumArray and data[] bytes is empty. I can see that value is not passing through createStruct correctly.
I tested it on drivers 7-12.1.0.2 and 8-12.2.0.1
db is Oracle 11c or 12c