I know it's been a while, but I have a solution to this problem.
As you said, when you use c3p0 connection pooling, the cursor should be a "NewProxyCallableStatement" and not an "OracleCallableStatement".
That is why you get this error.
I have had the same problem.
So to keep using c3p0, I have to use another way to get the cursor.
After calling:
Quote:
Session session = Util_Hibernate.getSession();
Connection con = session.connection();
CallableStatement callStmt = con.prepareCall("{call SPTEEST_VIEW(?,?)}");
callStmt.setInt(1,iPointerKey);
callStmt.registerOutParameter(2,OracleTypes.CURSOR);
callStmt.execute();
You should call:
Code:
ResultSet cursor = (ResultSet) callStmt.getObject(2);
If you are sure the output of your stored procedure is a "Ref Cursor", it should solve the problem.