After some Google searching, I found this example. It makes use of methods exclusive to the Oracle JDBC driver, namely:
After suiting it to your situation, perhaps this will work:
Warning: I have not compiled this myself.
int itemId = ...;
// This feature is only supported by the OCI driver:
Connection connection = DriverManager.getConnection("jdbc:oracle:oci8:@[HOST]", "[USER]", "[PASSWORD]");
CallableStatement callableStatement = connection.prepareCall("{? = utils.getParentsForItem(p_item_id => ?)}");
OracleCallableStatement oracleCallableStatement = (OracleCallableStatement) callableStatement;
int maximumElementsInTable = 150; // the maximum possible number of elements.
int elementSqlType = Types.INTEGER; // index table element SQL type (as defined in java.sql.Types or OracleTypes).
int elementMaxLen = 100; // maximum length of the element. If not specified, maximum length allowed for that type is used.
oracleCallableStatement.registerIndexTableOutParameter(
1,
maximumElementsInTable,
elementSqlType,
elementMaxLen
);
oracleCallableStatement.setInt(2, itemId);
oracleCallableStatement.execute();
int[] parentItemIds = oracleCallableStatement.getPlsqlIndexTable(1);