I'm trying to push "Arraylist" to oracle stored procedure and after making necessary modification, the object it is returned back.
I have an oracle stored procedure with an inout parameter which is "AS TABLE OF TYPE".
I'm able to make the call using Mybatis by implements TypeHandler and overrides its method public void setParameter(PreparedStatement ps, int i, Object parameter, JdbcType jdbcType) throws SQLException
But I'm facing issue while retrieving the object.
For retrieving I Override the below method.
public Object getResult(CallableStatement cs, int columnIndex) throws SQLException {
ARRAY array_to_pass = ((OracleCallableStatement) cs).getARRAY(1);
/* showing content */
Datum[] elements = array_to_pass.getOracleArray();
for (int i = 0; i < elements.length; i++) {
Object[] element = ((STRUCT) elements[i]).getAttributes();
String value = (String) element[0];
System.out.println("array(" + i + ").val=" + value);
}
}
I'm getting the below error java.lang.IllegalAccessError: tried to access class oracle.jdbc.driver.OracleCallableStatement
Statement generating the error is
ARRAY array_to_pass = ((OracleCallableStatement) cs).getARRAY(1);
Any thoughts/help on how to retrieve table of type object from oracle .