Skip to Content
0

The operation is not allowed for result set type FORWARD_ONLY.

May 30, 2017 at 05:12 PM

102

avatar image
Former Member

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.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
Lars Breddemann
May 31, 2017 at 03:10 AM
0

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

Show 3 Share
10 |10000 characters needed characters left characters exceeded
Former Member

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.

0

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-with-scrollmode-forward#40159370 ?

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?

0
Former Member

Thank you so much lars

0