We're updating the issue view to help you get more done. 

Support multiple result sets?

Description

Useful for stored procedure results:

call_proc.clj

1 2 3 4 5 (defn call-stored-proc [connection] (jdbc/query (myapp.db/connection) ["{call someProc()}"] :as-arrays? true))

Java code to handle multiple result sets:

MultiResults.java

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 public static void executeProcedure(Connection con) { try { CallableStatement stmt = con.prepareCall(...); ..... //Set call parameters, if you have IN,OUT, or IN/OUT parameters boolean results = stmt.execute(); int rsCount = 0; //Loop through the available result sets. while (results) { ResultSet rs = stmt.getResultSet(); //Retrieve data from the result set. while (rs.next()) { ....// using rs.getxxx() method to retieve data } rs.close(); //Check for next result set results = stmt.getMoreResults(); } stmt.close(); } catch (Exception e) { e.printStackTrace(); } }

Environment

None

Status

Assignee

Sean Corfield

Reporter

Sean Corfield

Labels

None

Approval

None

Patch

None

Priority

Major