I am using Oracle 12g and am trying to get a ResultSet
from a SYS_REFCURSOR
I have a procedure with the following signature:
CREATE OR REPLACE PROCEDURE proc_search(user IN VARCHAR2, res OUT SYS_REFCURSOR)
This is the Java JDBC code I am using:
try {
CallableStatement cstmt = con.prepareCall("exec proc_search(?, ?)");
cstmt.setString(1, login);
cstmt.registerOutParameter(2, Types.REF);
cstmt.execute();
ResultSet rs = (ResultSet)cstmt.getObject(2);
while (rs.next()) {
System.out.println(rs.getString(1));
}
} catch (Exception e) {
System.err.println(e);
e.printStackTrace();
}
However, I'm getting the following error:
java.sql.SQLException: ORA-03115: unsupported network datatype or representation