My Oracle Support Banner

Resultset Corrupted By reusing the Fetchsize API (Doc ID 1216993.1)

Last updated on SEPTEMBER 01, 2014

Applies to:

JDBC - Version 11.1.0.6 and later
Information in this document applies to any platform.

Symptoms

Result set returns incorrect data when the PreparedStatement is reused with reusing Fetchsize API. The issue replicates with 10.2 and 11.1 JDBC driver, and it does not occur with 11.2 version of the JDBC driver. The issue does not occur if the fetch size was not changed.

Example:-
PreparedStatement pstmt = conn.prepareStatement( "select * from testtable where id = ?");

pstmt.setInt(1, 17);
ResultSet rset = pstmt.executeQuery();
rset.setFetchSize(100);
while (rset.next())
System.out.println(rset.getInt(12));
rset.close();
pstmt.clearParameters();

pstmt.setInt(1, 17);
rset = pstmt.executeQuery();
rset.setFetchSize(100);
while (rset.next())
System.out.println(rset.getInt(12));
rset.close();
pstmt.clearParameters();

pstmt.setInt(1, 17);
rset = pstmt.executeQuery();
rset.setFetchSize(100);
while (rset.next())
System.out.println(rset.getInt(12));
rset.close();


Cause

To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!


In this Document
Symptoms
Cause
Solution
References

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.