I would need to pass Array in the call, but I couldn't find out feasible
way to wrap around my objects to java.sql.Array.
In Oracle, it appears I could use "ARRAY" to create, but ARRAY object
need ArrayDescriptor which requires access to Connection object, which I
am not sure how to get in the ibatis environment.
I am trying to play around the setParameter in TypeHandlerCallback
interface, here is what I come out. It works in Oracle environment, but
I would like to get some feedback before I check in the code.
Thanks.
public void setParameter(ParameterSetter setter, Object
parameter) throws SQLException {
if (parameter instanceof DBArray) {
DBArray arr = (DBArray)parameter;
// convert SQLData[] to Array
Statement stmt = setter.getPreparedStatement();
Connection conn = stmt.getConnection();
ArrayDescriptor desc = new ArrayDescriptor
(arr.getSqlType(), conn);
parameter = new ARRAY(desc, conn,
arr.getData());
}
setter.setObject(parameter);
}