I have a list of POJO's that I want to pass to an Oracle Stored Procedure and then loop through that list in the stored proc and run update statements
I've tried using a StructDescriptor but I keep getting an exception due to my connection object
(java.lang.ClassCastException: org.jboss.jca.adapters.jdbc.jdk6.WrappedConnectionJDK6 cannot be cast to oracle.jdbc.OracleConnection)
public void MyMethod(List<myObject> myObjectList) {
private Connection con = null;
private CallableStatement stmt = null;
try {
con = getConnection();
String query = "{call "+getStoredProcedureName()+"(?)}";
stmt.setArray(1, myObjectList);
stmt = con.prepareCall(query);
stmt.execute();
} catch(Exception e) {
throw e;
}
}
In Oracle
create or replace TYPE "MY_REC" AS OBJECT
(
field_one varchar2(50),
field_two varchar2(100)
);
create or replace TYPE "MY_REC_T" AS TABLE OF MY_REC;
I expect myObjectList to be passed to my stored procedure