Package railo.runtime.type

Examples of railo.runtime.type.QueryImpl


    // select
      SQL sqlSelect=new SQLImpl("select cfid,name from "+PREFIX+"_"+strType+"_data where expires<=?"
            ,new SQLItem[]{
           new SQLItemImpl(System.currentTimeMillis(),Types.VARCHAR)
        });
      QueryImpl query;
      try{
        query = new QueryImpl(ThreadLocalPageContext.get(),dc,sqlSelect,-1,-1,-1,"query");
    }
    catch(Throwable t){
      // possible that the table not exist, if not there is nothing to clean
      return;
    }
   
    int recordcount=query.getRecordcount();
   
    String cfid,name;
    for(int row=1;row<=recordcount;row++){
      cfid=Caster.toString(query.getAt(KeyConstants._cfid, row, null),null);
      name=Caster.toString(query.getAt(KeyConstants._name, row, null),null);
     
      if(listener!=null)listener.doEnd(engine, cleaner,name, cfid);
     
     
      ScopeContext.info(log,"remove "+strType+"/"+name+"/"+cfid+" from datasource "+dc.getDatasource().getName());
      engine.remove(type,name,cfid);
      SQLImpl sql = new SQLImpl("delete from "+StorageScopeDatasource.PREFIX+"_"+strType+"_data where cfid=? and name=?",new SQLItem[]{
          new SQLItemImpl(cfid,Types.VARCHAR),
          new SQLItemImpl(name,Types.VARCHAR)
          });
      new QueryImpl(ThreadLocalPageContext.get(),dc,sql,-1,-1,-1,"query");
     
     
     
    }
  }
View Full Code Here


      }
     
      // Resultset
      if(o instanceof ResultSet) {
        try {
          DumpData dd = new QueryImpl((ResultSet)o,"query",pageContext.getTimeZone()).toDumpData(pageContext,maxlevel,props);
          if(dd instanceof DumpTable)
            ((DumpTable)dd).setTitle(Caster.toClassName(o));
          return setId(id,dd);
        }
        catch (PageException e) {
View Full Code Here

      railo.commons.net.http.Header[] headers = rsp.getAllHeaders();
      StringBuffer raw=new StringBuffer(rsp.getStatusLine()+" ");
      Struct responseHeader = new StructImpl();
      Struct cookie;
      Array setCookie = new ArrayImpl();
      Query cookies=new QueryImpl(new String[]{"name","value","path","domain","expires","secure","httpOnly"},0,"cookies");
     
          for(int i=0;i<headers.length;i++) {
            railo.commons.net.http.Header header=headers[i];
            //print.ln(header);
           
View Full Code Here

              ResultSet rs=callStat.getResultSet();
              if(rs!=null) {
              try{
                result=(ProcResultBean) results.get(index++,null);
                if(result!=null) {
                  railo.runtime.type.Query q = new QueryImpl(rs,result.getMaxrows(),result.getName(),pageContext.getTimeZone())
                  count+=q.getRecordcount();
                  setVariable(result.getName(), q);
                  if(hasCached)cache.set(KeyImpl.getInstance(result.getName()), q);
                }
              }
              finally{
View Full Code Here

        return new StructImpl(type);
    }

    @Override
    public Query createQuery(String[] columns, int rows, String name) {
        return new QueryImpl(columns,rows,name);
    }
View Full Code Here

        return new QueryImpl(columns,rows,name);
    }

    @Override
    public Query createQuery(Collection.Key[] columns, int rows, String name) throws DatabaseException {
        return new QueryImpl(columns,rows,name);
    }
View Full Code Here

        return new QueryImpl(columns,rows,name);
    }
   
    @Override
    public Query createQuery(DatasourceConnection dc, SQL sql, int maxrow, String name) throws PageException {
    return new QueryImpl(ThreadLocalPageContext.get(),dc,sql,maxrow,-1,-1,name);
  }
View Full Code Here

    public Query createQuery(DatasourceConnection dc, SQL sql, int maxrow, String name) throws PageException {
    return new QueryImpl(ThreadLocalPageContext.get(),dc,sql,maxrow,-1,-1,name);
  }
   
    public Query createQuery(DatasourceConnection dc, SQL sql, int maxrow, int fetchsize, int timeout, String name) throws PageException {
    return new QueryImpl(ThreadLocalPageContext.get(),dc,sql,maxrow,fetchsize,timeout,name);
  }
View Full Code Here

  }
 
  private Query createQuery() throws DatabaseException {
    String v="VARCHAR";
    String d="DATE";
    railo.runtime.type.Query qry=new QueryImpl(
        new String[]{"type","name","detail","id","lastExecution","nextExecution","closed","tries","exceptions","triesmax"},
        new String[]{v,v,"object",v,d,d,"boolean","int","object","int"},
        0,"query");
    return qry;
  }
View Full Code Here

        }
       
       
        SQL sql=createSQL(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

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.