注册cursor类型参数¶
为了扩展java.sql.Types类型,神通数据库提供了自定义类型OscarTypes。CallableStatement注册参数时,如果存储过程中的参数为refcursor类型,则对应的注册参数类型为OscarTypes.CURSOR。
示例如下:
cstmt = con.prepareCall("{call TEST_PRO5(?,?)}");
cstmt.setFetchSize(2);
cstmt.registerOutParameter(1, OscarTypes.CURSOR);
cstmt.registerOutParameter(2, OscarTypes.CURSOR);
cstmt.execute();