Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

Pankaj, first all thanks for such a brief and helpful tutorial !! I have a situation where my stored procedure is receiving 2 string arrays as input, and 1 output as array of objects. Great if you can help with an example where the output is array of object. Below is my sample code… Procedure on SQL part : create or replace REPORT_ROWS(sls_array in SLS_ARRAY ,sp_array in SP_ARRAY,report_tabtype out LATEST_REPORT_TABTYPE) // JDBC part CallableStatement callStmt = conn.prepareCall(“{ call REPORT_ROWS(?,?,?)}”); ArrayDescriptor des_aray1 = ArrayDescriptor.createDescriptor(“schemaName.SLS_ARRAY”, conn); ARRAY sls_array = new ARRAY(des_aray1,conn,SLS_ARRAY_J); ArrayDescriptor des_aray2 = ArrayDescriptor.createDescriptor(“schemaName.SP_ARRAY”, conn); ARRAY sp_array = new ARRAY(des_aray2,conn,SP_ARRAY_J); callStmt.setArray(1, sls_array); callStmt.setArray(2, sp_array); callStmt.registerOutParameter(3, Types.ARRAY, “schemaName.LATEST_REPORT_TABTYPE”); System.out.println(callStmt.execute()); OUTPUT : false as no value is returned.
- Akram Khan
Dear Pankaj, Its awesome explanation. I was training somebody, I found this tutorial so interesting and alluring. Though I have added many more explanatory comments to my trainee, this was a very good starter. Thanx from bottom of my heart.
- Sreedhar Shastry
I did not see any explanation till now which is so simple and clear as the above. Thanks Pankaj…
- Jayasimha
Excellent job…thanks a lot!! You really helped me understand IN, OUT parameters of Stored Procedures.
- Maruthi
Hi Pankaj, Is there a way to get the name of the cursor at the java end, like here u have used out_cursor_emps as the cursor name. I have used resulset.getCursorName(), but it does not help.
- Ankit
Hi! The example of struct is equals for %ROWTYPE? when you declare in parameter of IN; CREATE OR REPLACE PROCEDURE insertEmployeeObject (IN_EMPLOYEE_OBJ IN EMPLOYEE%ROWTYPE, out_result OUT VARCHAR2) AS …
- Osiel
Nice sample, you should code your finally ; }finally{ try { if (rs != null) {rs.close();} } catch (SQLException e) { e.printStackTrace(); } try { if (stmt != null) {stmt.close();} } catch (SQLException e) { e.printStackTrace(); } try { if (con != null) {con.close();} } catch (SQLException e) { e.printStackTrace(); } try { input.close(); } catch (SQLException e) { e.printStackTrace(); } } Or use ressource writing (https://docs.oracle.com/javase/tutorial/essential/exceptions/tryResourceClose.html).
- Renaud91