@Override public int getMaxRows() throws SQLException { return targetStatement.getMaxRows(); }
@Override public int getMaxRows() throws SQLException { return statement.getMaxRows(); }
@Override public int getMaxRows() throws SQLException { return delegate.getMaxRows(); }
public int getMaxRows() throws SQLException { return stmt.getMaxRows(); }
@Override public final int getMaxRows() throws SQLException { return getRoutedStatements().isEmpty() ? -1 : getRoutedStatements().iterator().next().getMaxRows(); }
@Override public void run() throws Exception { stmt.getMaxRows(); } });
@Override public final int getMaxRows() throws SQLException { checkOpen(); try { return stmt.getMaxRows(); } catch (Throwable t) { throw checkException(t); } }
@Override public int statement_getMaxRows(StatementProxy statement) throws SQLException { if (this.pos < filterSize) { return nextFilter().statement_getMaxRows(this, statement); } return statement.getRawObject().getMaxRows(); }
private void assertMaxRowsLimit(int expectedLimit) throws SQLException { assertEquals(statement.getMaxRows(), expectedLimit); assertEquals(statement.getLargeMaxRows(), expectedLimit); }
@Test(expectedExceptions = SQLException.class, expectedExceptionsMessageRegExp = "Max rows exceeds limit of 2147483647") public void testMaxRowsExceedsLimit() throws SQLException { statement.setLargeMaxRows(Integer.MAX_VALUE * 10L); statement.getMaxRows(); }
if ( statement.getMaxRows() != 0 ) { statement.setMaxRows( 0 );
@Override public Connection connect( String url, Properties info ) throws SQLException { Connection conn = mock( Connection.class ); Statement stmt = mock( Statement.class ); ResultSet rs = mock( ResultSet.class ); ResultSetMetaData md = mock( ResultSetMetaData.class ); when( stmt.getMaxRows() ).thenReturn( 5 ); when( stmt.getResultSet() ).thenReturn( rs ); when( stmt.executeQuery( anyString() ) ).thenReturn( rs ); when( rs.getMetaData() ).thenReturn( md ); when( rs.getLong( anyInt() ) ).thenReturn( 5L ); when( rs.next() ).thenAnswer( new Answer<Boolean>() { private int count = 0; public Boolean answer( org.mockito.invocation.InvocationOnMock invocation ) throws Throwable { return count++ == 0; } } ); when( md.getColumnCount() ).thenReturn( 1 ); when( md.getColumnName( anyInt() ) ).thenReturn( "count" ); when( md.getColumnType( anyInt() ) ).thenReturn( java.sql.Types.INTEGER ); when( conn.createStatement() ).thenReturn( stmt ); return conn; }
private boolean canWeSetFetchSize( Statement statement ) throws SQLException { return databaseMeta.isFetchSizeSupported() && ( statement.getMaxRows() > 0 || databaseMeta.getDatabaseInterface() instanceof PostgreSQLDatabaseMeta || ( databaseMeta.isMySQLVariant() && databaseMeta.isStreamingResults() ) ); }
stmt.setMaxRows(1); assert stmt.getMaxRows() == 1;
if ( statement.getMaxRows() != 0 ) { statement.setMaxRows( 0 );
sel_stmt = connection.createStatement( ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY ); try { if ( databaseMeta.isFetchSizeSupported() && sel_stmt.getMaxRows() >= 1 ) { if ( databaseMeta.getDatabaseInterface().isMySQLVariant() ) { sel_stmt.setFetchSize( Integer.MIN_VALUE );
assertEquals(0, stmt.getMaxRows()); ); assertEquals(0, stmt.getMaxRows()); assertEquals(maxRows, stmt.getMaxRows());
@Override public int getMaxRows() throws SQLException { return this.innerStatement.getMaxRows(); }
@Override public int getMaxRows() throws SQLException { return stmt.getMaxRows(); }
log.snap( Metrics.METRIC_DATABASE_CREATE_SQL_STOP, databaseMeta.getName() ); if ( canWeSetFetchSize( sel_stmt ) ) { int fs = Const.FETCH_SIZE <= sel_stmt.getMaxRows() ? sel_stmt.getMaxRows() : Const.FETCH_SIZE; if ( databaseMeta.getDatabaseInterface().isMySQLVariant() && databaseMeta.isStreamingResults() ) {