cancel
Showing results for 
Search instead for 
Did you mean: 

The operation is not allowed for result set type FORWARD_ONLY

Former Member
0 Kudos

Hi,

I am trying to use scroll insensitive resultset in following manner-

Statement stmt = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_READ_ONLY);
ResultSet rs = stmt.executeQuery("some sql here");
rs.last();

but the rs.last() throws this exception-

com.sap.dbtech.jdbc.exceptions.SQLExceptionSapDB: The operation is not allowed for result set type FORWARD_ONLY.
	at com.sap.dbtech.jdbc.ResultSetSapDB.assertNotForwardOnly(ResultSetSapDB.java:2725)
	at com.sap.dbtech.jdbc.ResultSetSapDB.last(ResultSetSapDB.java:557)

Database version: Kernel 7.5.0 Build 019-121-082-363

Driver Version: MaxDB JDBC Driver, MySQL MaxDB, 7.6.0 Build 030-000-005-567

This used to work with 7.5 version driver. Why this is failing with 7.6 driver, any clues?

Thanks,

Vinod

Accepted Solutions (0)

Answers (1)

Answers (1)

0 Kudos

Hi Vinod,

due to performance improvement when using forward only cursor we changed the default for the resultset type from TYPE_SCROLL_SENSITIVE to TYPE_FORWARD_ONLY starting with JDBC driver version 7.6. So I guess the exception comes from a statement where you didn't set the resultset type while creating it. Please check if all of the statements that you want to be scrollable have set the correct resultset type.

Regards,

Marco

Former Member
0 Kudos

Yes, that was also a cause of problems I faced after upgrading to Java 6. Driver v7.5 was gone mad with Java 6 and misbehaving in grossly unexpected ways and v7.6 having this kind of problems.

Thanks,

Vinod