开发者

How to obtain an scroll_insensitive resultSet from a callableStatement in Java JDBC?

I have a stored procedure in an Oracle 10g database, in my java code, i call it with:

CallableStatement cs = bdr.prepareCall("Begin ADMBAS01.pck_basilea_reportes.cargar_reporte(?,?,?,?,?); END;", ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
    cs.setInt(1, this.reportNumber);
    cs.registerOutParameter(开发者_开发技巧2, OracleTypes.CURSOR);
    cs.registerOutParameter(3, OracleTypes.INTEGER);
    cs.registerOutParameter(4, OracleTypes.VARCHAR);
    cs.setDate(5, new java.sql.Date(this.fecha1.getTime()));
    cs.execute();

ResultSet rs = (ResultSet)cs.getObject(2);

i do obtain an ResultSet with correct records in it, but when i try an "scroll_insensitive - only" operation, (like absolute(1) ). I keep getting an SQLException stating that it doesn't work on FORWARD only resultSet.

So how can i obtain this ResultSet with scroll_insensitive capabilites?

Thanks in Advance.


The result set type is merely a suggestion to the driver, which the driver can ignore or downgrade to FORWARD_ONLY if it can't comply. See here for details.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜