final RowSelection selection = queryParameters.getRowSelection();
boolean useLimit = LimitHelper.useLimit( limitHandler, selection );
boolean hasFirstRow = LimitHelper.hasFirstRow( selection );
boolean useLimitOffset = hasFirstRow && useLimit && limitHandler.supportsLimitOffset();
boolean callable = queryParameters.isCallable();
final ScrollMode scrollMode = getScrollMode( scroll, hasFirstRow, useLimitOffset, queryParameters );
PreparedStatement st = session.getTransactionCoordinator().getJdbcCoordinator().getStatementPreparer().prepareQueryStatement(
sql,
callable,
scrollMode