daily pastebin goal
41%
SHARE
TWEET

Untitled

a guest Jan 18th, 2019 58 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public class DB2MainframeSystemNamingPlatform extends DB2MainframePlatform {
  2.  
  3. @Override
  4. public void printSQLSelectStatement(DatabaseCall call, ExpressionSQLPrinter printer, SQLSelectStatement statement){
  5.     int max = 0;
  6.     int firstRow = 0;
  7.  
  8.     if (statement.getQuery()!=null){
  9.         max = statement.getQuery().getMaxRows();
  10.         firstRow = statement.getQuery().getFirstResult();
  11.     }
  12.  
  13.     if ( !(this.shouldUseRownumFiltering()) || ( !(max>0) && !(firstRow>0) ) ){
  14.         super.printSQLSelectStatement(call, printer, statement);
  15.         return;
  16.     } else if ( max > 0 ){
  17.         call.setFields(statement.printSQL(printer));
  18.         printer.printString(" LIMIT ");
  19.         printer.printParameter(DatabaseCall.MAXROW_FIELD);
  20.         printer.printString(" OFFSET ");
  21.         printer.printParameter(DatabaseCall.FIRSTRESULT_FIELD);
  22.     } else {
  23.         call.setFields(statement.printSQL(printer));
  24.         printer.printString(" OFFSET ");
  25.         printer.printParameter(DatabaseCall.FIRSTRESULT_FIELD);
  26.     }
  27.     call.setIgnoreFirstRowSetting(true);
  28.     call.setIgnoreMaxResultsSetting(true);
  29. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top