Skip to Main Content

Java Database Connectivity (JDBC)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

resultset.setFetchSize() Exception : invalid Fetch Size .... :-(

843854Aug 4 2003 — edited Aug 5 2003
dear all, I have "Invalid Fetch Size" exception when execute the following statements :

try {
int count = 0;
rs.setFetchSize(100);

while (rs.next()) {
System.out.println("Rows: " + (++count));
}

}catch (java.sql.SQLException e) {
System.out.println("java.sql.SQLException : " +e.toString());
}

I using Oracle and try to retrieve a huge data from a table. It tooks long time in the while loops and sometime hits the "out of memory" error. That is why i try to use fetch method. Do I need to do setFetchDirection()?? or do i need to do setFetchSize() on the statement? what is different doing setFetchSize() at statement and resultset??

Thanks in Advance.

From
CBLC
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 2 2003
Added on Aug 4 2003
6 comments
652 views