Accessing the Custom Object Return type from ojdbc6 JDBC Thin Drivers
Posted
by Andrew Harmel-Law
on Stack Overflow
See other posts from Stack Overflow
or by Andrew Harmel-Law
Published on 2010-06-03T12:15:29Z
Indexed on
2010/06/03
12:44 UTC
Read the original article
Hit count: 369
I'm writing some JDBC code which calls a Oracle 11g PL/SQL procdedure which has a Custom Object return type. I can get the code to call the procedure, but how do I access the returned Custom Object to obtain it's contained values?. An example of my code calling the procedure is below:
PLSQL Code:
Procedure GetDataSummary (p_my_key IN KEYS.MY_KEY%TYPE,
p_recordset OUT data_summary_tab,
p_status OUT VARCHAR2);
Java Code:
String query = "begin manageroleviewdata.getdatasummary(?, ?, ?); end;");
CallableStatement stmt = conn.prepareCall(query);
stmt.setInt(1, 83);
stmt.registerOutParameter(2, OracleTypes.ARRAY, "DATA_SUMMARY_TAB");
stmt.registerOutParameter(3, OracleTypes.VARCHAR);
stmt.execute(stmt);
How do I get the result back fron this?
© Stack Overflow or respective owner