I am calling one sp with few out params and as per my requirement,I need to use ResultSet on some condition and out params on other conditions. But using executeQuery(), I am getting, JZ0R0: ResultSet has already been closed error.(I am using Sybase 15)
Here is the example:
Connection conn = ~~;
CallableStatement cstmt = conn.prepareCall("{call my_sp(?)");
cstmt.registerOutParameter(1,java.sql.Types.INTEGER);
ResultSet rs = cstmt.executeQuery();
If i try to do, below code now,
int res = cstmt.getInt(1);
Then try to iterate the ResultSet object, as below, then I get above ResultSet close error.
ResultSetMetaData rsmd = rs.getMetaData();
Is there any way I can get the output param value and then iterate on ResultSet object or vice-versa?