/** * Advance the cursor to the first required row of the <tt>ResultSet</tt> */ protected void advance(final ResultSet rs, final RowSelection selection) throws SQLException { final int firstRow = LimitHelper.getFirstRow( selection ); if ( firstRow != 0 ) { if ( getFactory().getSettings().isScrollableResultSetsEnabled() ) { // we can go straight to the first required row rs.absolute( firstRow ); } else { // we need to step through the rows one row at a time (slow) for ( int m = 0; m < firstRow; m++ ) { rs.next(); } } } }
protected ScrollMode getScrollMode(boolean scroll, boolean hasFirstRow, boolean useLimitOffSet, QueryParameters queryParameters) { final boolean canScroll = getFactory().getSettings().isScrollableResultSetsEnabled(); if ( canScroll ) { if ( scroll ) { return queryParameters.getScrollMode(); } if ( hasFirstRow && !useLimitOffSet ) { return ScrollMode.SCROLL_INSENSITIVE; } } return null; }
private CallableStatement getCallableStatement( final Connection conn, final String sql, boolean scrollable) throws SQLException { if ( scrollable && !factory.getSettings().isScrollableResultSetsEnabled() ) { throw new AssertionFailure("scrollable result sets are not enabled"); } log(sql); log.trace("preparing callable statement"); if (scrollable) { return conn.prepareCall(sql, ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY); } else { return conn.prepareCall(sql); } }
/** * Advance the cursor to the first required row of the <tt>ResultSet</tt> */ private void advance(final ResultSet rs, final RowSelection selection) throws SQLException { final int firstRow = getFirstRow( selection ); if ( firstRow != 0 ) { if ( getFactory().getSettings().isScrollableResultSetsEnabled() ) { // we can go straight to the first required row rs.absolute( firstRow ); } else { // we need to step through the rows one row at a time (slow) for ( int m = 0; m < firstRow; m++ ) rs.next(); } } }
/** * Advance the cursor to the first required row of the <tt>ResultSet</tt> */ private void advance(final ResultSet rs, final RowSelection selection) throws SQLException { final int firstRow = getFirstRow( selection ); if ( firstRow != 0 ) { if ( getFactory().getSettings().isScrollableResultSetsEnabled() ) { // we can go straight to the first required row rs.absolute( firstRow ); } else { // we need to step through the rows one row at a time (slow) for ( int m = 0; m < firstRow; m++ ) rs.next(); } } }
/** * Advance the cursor to the first required row of the <tt>ResultSet</tt> */ private void advance(final ResultSet rs, final RowSelection selection) throws SQLException { final int firstRow = getFirstRow( selection ); if ( firstRow != 0 ) { if ( getFactory().getSettings().isScrollableResultSetsEnabled() ) { // we can go straight to the first required row rs.absolute( firstRow ); } else { // we need to step through the rows one row at a time (slow) for ( int m = 0; m < firstRow; m++ ) rs.next(); } } }
/** * Advance the cursor to the first required row of the <tt>ResultSet</tt> */ private void advance(final ResultSet rs, final RowSelection selection) throws SQLException { final int firstRow = getFirstRow( selection ); if ( firstRow != 0 ) { if ( getFactory().getSettings().isScrollableResultSetsEnabled() ) { // we can go straight to the first required row rs.absolute( firstRow ); } else { // we need to step through the rows one row at a time (slow) for ( int m = 0; m < firstRow; m++ ) rs.next(); } } }
private CallableStatement getCallableStatement( final Connection conn, String sql, boolean scrollable) throws SQLException { if ( scrollable && !factory.getSettings().isScrollableResultSetsEnabled() ) { throw new AssertionFailure("scrollable result sets are not enabled"); } sql = getSQL( sql ); log( sql ); log.trace("preparing callable statement"); if ( scrollable ) { return conn.prepareCall( sql, ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY ); } else { return conn.prepareCall( sql ); } }
private ScrollMode getScrollMode(boolean scroll, boolean hasFirstRow, boolean useLimitOffSet, QueryParameters queryParameters) { final boolean canScroll = getFactory().getSettings().isScrollableResultSetsEnabled(); if ( canScroll ) { if ( scroll ) { return queryParameters.getScrollMode(); } if ( hasFirstRow && !useLimitOffSet ) { return ScrollMode.SCROLL_INSENSITIVE; } } return null; } /**
private ScrollMode getScrollMode(boolean scroll, boolean hasFirstRow, boolean useLimitOffSet, QueryParameters queryParameters) { final boolean canScroll = getFactory().getSettings().isScrollableResultSetsEnabled(); if ( canScroll ) { if ( scroll ) { return queryParameters.getScrollMode(); } if ( hasFirstRow && !useLimitOffSet ) { return ScrollMode.SCROLL_INSENSITIVE; } } return null; } /**
final ScrollMode scrollMode, final boolean callable) throws SQLException { if ( scrollable && !factory.getSettings().isScrollableResultSetsEnabled() ) { throw new AssertionFailure("scrollable result sets are not enabled");
throws SQLException { if ( scrollable && !factory.getSettings().isScrollableResultSetsEnabled() ) { throw new AssertionFailure("scrollable result sets are not enabled");
final ScrollMode scrollMode) { if ( scrollMode != null && !scrollMode.equals( ScrollMode.FORWARD_ONLY ) ) { if ( ! settings().isScrollableResultSetsEnabled() ) { throw new AssertionFailure("scrollable result sets are not enabled");
final ScrollMode scrollMode) { if ( scrollMode != null && !scrollMode.equals( ScrollMode.FORWARD_ONLY ) ) { if ( ! settings().isScrollableResultSetsEnabled() ) { throw new AssertionFailure("scrollable result sets are not enabled");
boolean callable = queryParameters.isCallable(); final boolean canScroll = getFactory().getSettings().isScrollableResultSetsEnabled(); final boolean useScrollableResultSetToSkip = hasFirstRow && !useLimitOffset && canScroll;
boolean callable = queryParameters.isCallable(); final boolean canScroll = getFactory().getSettings().isScrollableResultSetsEnabled(); final boolean useScrollableResultSetToSkip = hasFirstRow && !useLimitOffset && canScroll;
getFactory().getSettings().isScrollableResultSetsEnabled(); ScrollMode scrollMode = scroll ? queryParameters.getScrollMode() : ScrollMode.SCROLL_INSENSITIVE;