Package railo.runtime.type

Examples of railo.runtime.type.QueryImpl


    Stopwatch stopwatch=new Stopwatch(Stopwatch.UNIT_NANO);
    stopwatch.start();
       
    checkTable(metaData);
    ResultSet result = metaData.getSchemas();
    Query qry = new QueryImpl(result,"query",pageContext.getTimeZone());
   
   
    qry.rename(TABLE_SCHEM,USER);
       
        qry.setExecutionTime(stopwatch.time());
       
       
    pageContext.setVariable(name, qry);
  }
View Full Code Here


        }
     
        String[] pKeys=getPrimaryKeys(dc);
      SQL sql=createSQL(dc,pKeys,meta);
      if(sql!=null) {
        railo.runtime.type.Query query = new QueryImpl(pageContext,dc,sql,-1,-1,-1,"query");
       
        if(pageContext.getConfig().debug()) {
          String dsn=ds instanceof DataSource?((DataSource)ds).getName():Caster.toString(ds);
          boolean logdb=((ConfigImpl)pageContext.getConfig()).hasDebugOptions(ConfigImpl.DEBUG_DATABASE);
          if(logdb){
            boolean debugUsage=DebuggerUtil.debugQueryUsage(pageContext,query);
            ((DebuggerPro)pageContext.getDebugger()).addQuery(debugUsage?query:null,dsn,"",sql,query.getRecordcount(),pageContext.getCurrentPageSource(),query.getExecutionTime());
          }
        }
      }
      return EVAL_PAGE;
    }
View Full Code Here

        catch (SQLException e) {
            throw new DatabaseException(e,dc);
        }
       
        try {
            return new QueryImpl(meta.getPrimaryKeys(tablequalifier, tableowner, tablename),-1,"query",pageContext.getTimeZone());
        }
    catch (SQLException e) {
        try {
            return new QueryImpl(meta.getBestRowIdentifier(tablequalifier, tableowner, tablename, 0, false),-1,"query",pageContext.getTimeZone());
            }
        catch (SQLException sqle) {
                throw new DatabaseException("can't find primary keys of table ["+tablename+"] ("+ExceptionUtil.getMessage(sqle)+")",null,null,dc);
            }
        }
View Full Code Here

    try {
      if(lazy && !createUpdateData && cachedWithin==null && cachedafter==null && result==null)
        return new SimpleQuery(dc,sql,maxrows,blockfactor,timeout,getName(),pageContext.getCurrentPageSource().getDisplayPath(),tz);
     
     
      return new QueryImpl(pageContext,dc,sql,maxrows,blockfactor,timeout,getName(),pageContext.getCurrentPageSource().getDisplayPath(),createUpdateData,true);
    }
    finally {
      manager.releaseConnection(pageContext,dc);
    }
  }
View Full Code Here

    int trgRows = srcRows-start+1;
    if (trgRows > pageSize) trgRows = pageSize;
    if(trgRows<0)trgRows=0;
   
    Query trg=new QueryImpl(srcColumns,trgRows,src.getName());
    int trgRow=0;
    for (int srcRow = start; (srcRow <= end) && (srcRow <= srcRows); srcRow++) {
      trgRow++;
      for (int col = 0; col < srcColumns.length; col++){
        trg.setAtEL(
          srcColumns[col],
          trgRow,
          src.getAt(srcColumns[col],srcRow, null));
      }
    }
View Full Code Here

        }
        else throw new DatabaseException("invalid argument for function query, only array as value are allowed","example: query(column1:array(1,2,3))",null,null);
      }
      else throw new DatabaseException("invalid argument for function query, only named argument are allowed","example: query(column1:array(1,2,3))",null,null);
    }
    Query query=new QueryImpl(names,columns,"query");
    return query;
  }
View Full Code Here

public final class QueryNew extends BIF {

  private static final long serialVersionUID = -4313766961671090938L;
 
  public static railo.runtime.type.Query call(PageContext pc , String columnList) throws DatabaseException {
      return new QueryImpl(ListUtil.listToArrayTrim(columnList,","),0,"query");
  }
View Full Code Here

  public static railo.runtime.type.Query call(PageContext pc , String columnList) throws DatabaseException {
      return new QueryImpl(ListUtil.listToArrayTrim(columnList,","),0,"query");
  }
  public static railo.runtime.type.Query call(PageContext pc , String columnList, String columnTypeList) throws PageException {
    if(StringUtil.isEmpty(columnTypeList)) return call(pc, columnList);
    return new QueryImpl(ListUtil.listToArrayTrim(columnList,","),ListUtil.listToArrayTrim(columnTypeList,","),0,"query");
  }
View Full Code Here

 
  public static railo.runtime.type.Query call(PageContext pc , String strColumnList, String strColumnTypeList, Object data) throws PageException {
    Array columnList = ListUtil.listToArrayTrim(strColumnList,",");
    railo.runtime.type.Query qry;
    if(StringUtil.isEmpty(strColumnTypeList))
      qry= new QueryImpl(columnList,0,"query");
    else
      qry= new QueryImpl(columnList,ListUtil.listToArrayTrim(strColumnTypeList,","),0,"query");
   
    if(data==null) return qry;
    return populate(pc, qry, data)
  }
View Full Code Here

  }

  private static Query get(Query qry, int from, int to) throws PageException {
    Collection.Key[] columns;
    //print.out(from+"::"+to);
    Query nq=new QueryImpl(columns=qry.getColumnNames(),0,qry.getName());
   
    int row=1;
    for(int i=from;i<=to;i++) {nq.addRow();
      for(int y=0;y<columns.length;y++) {
        nq.setAt(columns[y], row, qry.getAt(columns[y], i));
      }
      row++;
    }
    return nq;
  }
View Full Code Here

TOP

Related Classes of railo.runtime.type.QueryImpl

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.