Examples of SQLParser


Examples of org.jiql.util.SQLParser

          return rn;
      }
      return null;
}
public SQLParser getSQLParser(String t)throws SQLException{
SQLParser s = sqps.get(t);
if (s != null){
  if (sqp != null && sqp.getConnection().isRemote())
    s.setConnection(sqp.getConnection());
  s.setTable(t);
return s;
}
View Full Code Here

Examples of org.jiql.util.SQLParser

    //r = new Row();
    r.put("tablename","jiql");
    //r.setRowId("2");
    v.add(r);*/
   
    SQLParser sqp = new SQLParser("TABLE_CAT",connection);
    sqp.setAction("showTables");
     
    org.jiql.jdbc.ResultSet jresult = new org.jiql.jdbc.ResultSet(v,sqp);
    jresult.setIsCatalog(true);
        return jresult;
    }
View Full Code Here

Examples of org.jiql.util.SQLParser

}

SQLParser add(String t)throws SQLException{


SQLParser s = sqps.get(t);
if (s == null){
  if (sqp != null && sqp.getTable() != null && sqp.getTable().equals(t))
    return null;
  s = new SQLParser(sqp.getProperties());
  s.setTable(t);
  sqps.put(t,s);
}
return s; 
}
View Full Code Here

Examples of org.jiql.util.SQLParser

return s; 
}

public void merge()throws SQLException{
  if (sqps.size() < 1)return;
  SQLParser s = (SQLParser)sqps.remove(sqp.getTable());
  if (s != null){
 
    sqp.mergeAliases(s.getAliases());
    Vector v2 = s.getOriginalSelectList();
    sqp.setOriginalSelectList(v2);
   
 
  }
  //(sqp.getOriginalSelectList() + " SELECTSSS U 2b " + sqp.getSelectList());

  String al = (String) sqp.getAliases().get(sqp.getTable());
  if (al != null){
  s = (SQLParser)sqps.remove(al);
  if (s != null)
    sqp.mergeAliases(s.getAliases());   
  }
  if (sqps.size() > 0)
  {

    Hashtable h = sqp.getAliases();
    Enumeration en1 = h.keys();

    while (en1.hasMoreElements()){
    String n = en1.nextElement().toString();
    String nv = (String)h.get(n);
    if (nv.equals(sqp.getTable()))
    {

      s = (SQLParser)sqps.remove(n);
      if (s != null)
      {
Hashtable v =  s.getSelectAS();
  Hashtable v2 =  sqp.getSelectAS();
  Enumeration en = v.keys();
  String k = null;
  while (en.hasMoreElements()){
 
    k = en.nextElement().toString();

    v2.put(k,v.get(k));
  }
 
    Vector vv =  s.getSelectList();
  Vector vv2 =  sqp.getSelectList();
  en = vv.elements();
  String itm = null;
  while (en.hasMoreElements()){
    itm = en.nextElement().toString();
  //(itm + " SELECTSSS U 2c " + sqp.getSelectList() + ":" + vv2.contains(itm) + s.getTable());

        if (itm.endsWith(".*") )
        {
          vv2.remove(itm);

          Vector fl = sqp.getJiqlTableInfo().getFieldList();
          String an = itm.substring(0,itm.length() - 1);
          for (int fct = 0;fct < fl.size();fct++){
            itm = an + fl.elementAt(fct).toString();
          addToTheSelectList(itm);
          //(!addToTheSelectList(itm))
    if (!vv2.contains(itm)){
    vv2.add(itm);
    }
        }
        }

  else if(!addToTheSelectList(itm))
    if (!vv2.contains(itm)){
    vv2.add(itm);
    }
  }
  sqp.updateSelects();       
 
 
 
        Vector v2b = s.getOriginalSelectList();
    sqp.setOriginalSelectList(v2b);

 
 
 
View Full Code Here

Examples of org.jiql.util.SQLParser

 
  }*/
}
void selectASPut(String t,String c,String a)throws SQLException{

        SQLParser sq = add(t);
        Hashtable sl = sq.getSelectAS();
                //(a + " SELECTSSS U " + c);

          sl.put(a,c);

        //sl.put(c,a);
View Full Code Here

Examples of org.jiql.util.SQLParser

      jeitheroralllist.add(cr);
      return true;
    }
    String tab = isFilter(left,right,cr);
    if (tab != null){
      SQLParser sq = add(tab);
      Vector il = sq.getEitherOrAllList();
      cr.setSQLParser(sq);
      il.add(cr);
      return true;
    }
View Full Code Here

Examples of org.jiql.util.SQLParser

      jincludealllist.add(cr);
      return true;
    }
    String tab = isFilter(left,right,cr);
    if (tab != null){
      SQLParser sq = add(tab);
      Vector il = sq.getIncludeAllList();
      cr.setSQLParser(sq);
      il.add(cr);
      return true;
    }
    return false;
View Full Code Here

Examples of org.jiql.util.SQLParser

   
 
  en = sqps.keys();
  Enumeration en2 = null;
  Hashtable h = null;
  SQLParser sq = null;
  while (en.hasMoreElements()){
    t = (String)en.nextElement();
  if (l.startsWith(t + "."))
    return t;
    sq = add(t);
    h = sq.getSelectAS();
    en2 = h.keys();
    while (en2.hasMoreElements())
    {
      n = (String)en2.nextElement();
      if (n.equals(l))
View Full Code Here

Examples of org.jiql.util.SQLParser

      {
        String t2 = (String)aliases.get(t);
        if (t2 != null)
          t = t2;
      }
      SQLParser s = getSQLParser(t);
      if (s != null){
        Vector sl = s.getSelectList();
        /*if (sl == null){
          sl = new Vector();
          selects.put(t,sl);
        }*/

      //itm = sqp.parseSelectAlias(itm);
      i =  itm.toLowerCase().indexOf(" as ");
      if (i > 0){
     
      String itmn = (StringUtil.getTrimmedValue(itm.substring(0,i)));
      String itmn2 = StringUtil.getTrimmedValue(itm.substring(i + 3,itm.length()));
      selectASPut(t,itmn,itmn2);
      itm = itmn2;
      }
      //else //(" NO AS 1 " + itm);
      //}else
          //(t + " SELECTSSS U 4 " + itm);

        sl.add(itm);
        return true;
      }
      t = (String)aliases.get(t);
      if (t != null){
      s = add(t);
      if (s != null){
        Vector sl = s.getSelectList();
        /*if (sl == null){
          sl = new Vector();
          selects.put(t,sl);
        }*/
      i =  itm.toLowerCase().indexOf(" as ");
View Full Code Here

Examples of org.jiql.util.SQLParser

      {
        String t2 = (String)aliases.get(t);
        if (t2 != null)
          t = t2;
      }
      SQLParser s = add(t);
      if (s != null){
        Vector sl = s.getSelectList();
        /*if (sl == null){
          sl = new Vector();
          selects.put(t,sl);
        }*/

      //itm = sqp.parseSelectAlias(itm);
      //itm = s.getSFunctions().parse(itm);

      i =  itm.toLowerCase().indexOf(" as ");
      if (i > 0){
     
      String itmn = (StringUtil.getTrimmedValue(itm.substring(0,i)));
      String itmn2 = StringUtil.getTrimmedValue(itm.substring(i + 3,itm.length()));
      selectASPut(t,itmn,itmn2);
      itm = itmn2;
      }      //else //(" NO AS 3 " + itm);

     
      /* (t + " SELECTSSS U 2 " + itm);
        if (itm.endsWith(".*"))
        {
          String tn = findTable(t);
       (t + " SELECTSSS U 24u " + tn + ":" + aliases);

          Vector fl = jiqlDBMgr.get(sqp.getProperties()).getTableInfo(tn).getFieldList();
          String an = itm.substring(0,itm.length() - 1);
          for (int fct = 0;fct < fl.size();fct++)
            sl.add(an + fl.elementAt(fct));
        }
        else*/
        sl.add(itm);
        return true;
      }
      t = (String)aliases.get(t);
      if (t != null){
      s = add(t);
      if (s != null){
        Vector sl = s.getSelectList();
        /*if (sl == null){
          sl = new Vector();
          selects.put(t,sl);
        }*/
      i =  itm.toLowerCase().indexOf(" as ");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.