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,

Facing the below exception when im trying to access the ScrollableResults.first() and ScrollableResults.last(). Can any one help me out.

Does SAP HANA JDBC driver support only FORWARD_ONLY cursor ?

Caused by: org.hibernate.exception.GenericJDBCException: could not advance using first() at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:54) com.sap.db.jdbc.exceptions.JDBCDriverException: SAP DBTech JDBC: The operation is not allowed for result set type FORWARD_ONLY.

Accepted Solutions (1)

Accepted Solutions (1)

lbreddemann
Active Contributor
0 Kudos

Correct, the HANA JDBC driver only supports the FORWARD_ONLY cursor type. (checked with HANA 2 JDBC driver 2.1.2).

Former Member
0 Kudos

Thank you so much Lars.

Is there any way to support SCROLL_INSENSITIVE cursor as in our application we use ScrollableResults methods like ScrollableResults.first() and ScrollableResults.last() which are valid in other JDBC drivers.

lbreddemann
Active Contributor
0 Kudos

Gee... Google seems to be broken... *cough*.

Why not have a look e.g. here https://stackoverflow.com/questions/40152908/hibernate-get-the-last-element-of-a-scrollableresults-w... ?

Generally speaking: no, if the driver doesn't support scrollable result sets, then there's no way to "convice" it to still accept the method calls.

So, whatever your application actually wants to do with the calls to the hibernate resultset, you may want to check whether the first()/last() operation is available before using it.

Out of interest: what do you do with the first/last record in your application?

Former Member
0 Kudos

Thank you so much lars

Answers (0)