Package railo.runtime.exp

Examples of railo.runtime.exp.DatabaseException


       
    try
        fillResult(null,result,-1,true,false,tz);
    }
    catch (SQLException e) {
      throw new DatabaseException(e,null);
    }
    catch (Exception e) {
        throw Caster.toPageException(e);
    }
  }
View Full Code Here


        }
      }
      while(true);
    }
    catch (SQLException e) {
      throw new DatabaseException(e,sql,dc);
    }
    catch (Throwable e) {
      throw Caster.toPageException(e);
    }
        finally {
View Full Code Here

   * @throws DatabaseException
   */
  public QueryImpl(String[] strColumns, String[] strTypes, int rowNumber, String name) throws DatabaseException {
        this.name=name;
        columncount=strColumns.length;
    if(strTypes.length!=columncount) throw new DatabaseException("columns and types has not the same count",null,null,null);
    recordcount=rowNumber;
    columnNames=new Collection.Key[columncount];
    columns=new QueryColumnImpl[columncount];
    for(int i=0;i<strColumns.length;i++) {
      columnNames[i]=KeyImpl.init(strColumns[i].trim());
View Full Code Here

   */
  public QueryImpl(Collection.Key[] columnNames, String[] strTypes, int rowNumber, String name) throws DatabaseException {
        this.name=name;
        this.columnNames=columnNames;
        columncount=columnNames.length;
    if(strTypes.length!=columncount) throw new DatabaseException("columns and types has not the same count",null,null,null);
    recordcount=rowNumber;
    columns=new QueryColumnImpl[columncount];
    for(int i=0;i<columnNames.length;i++) {
      columns[i]=new QueryColumnImpl(this,columnNames[i],SQLCaster.toIntType(strTypes[i]),recordcount);
    }
View Full Code Here

   * @throws PageException
   */
  public QueryImpl(Array arrColumns, Array arrTypes, int rowNumber, String name) throws PageException {
        this.name=name;
        columncount=arrColumns.size();
    if(arrTypes.size()!=columncount) throw new DatabaseException("columns and types has not the same count",null,null,null);
    recordcount=rowNumber;
    columnNames=new Collection.Key[columncount];
    columns=new QueryColumnImpl[columncount];
    for(int i=0;i<columncount;i++) {
      columnNames[i]=KeyImpl.init(arrColumns.get(i+1,"").toString().trim());
View Full Code Here

      // Only allow column names that are valid variable name
      //if(!Decision.isSimpleVariableName(columnNames[i]))
      //  throw new DatabaseException("invalid column name ["+columnNames[i]+"] for query", "column names must start with a letter and can be followed by letters numbers and underscores [_]. RegExp:[a-zA-Z][a-zA-Z0-9_]*",null,null,null);
     
      if(testMap.contains(columnNames[i].getLowerString()))
        throw new DatabaseException("invalid parameter for query, ambiguous column name "+columnNames[i],"columnNames: "+ListUtil.arrayToListTrim( _toStringKeys(columnNames),","),null,null);
      testMap.add(columnNames[i].getLowerString());
    }
  }
View Full Code Here

  public QueryImpl(Collection.Key[] columnNames, Array[] arrColumns, String name) throws DatabaseException {
        this.name=name;
       
        if(columnNames.length!=arrColumns.length)
      throw new DatabaseException("invalid parameter for query, not the same count from names and columns","names:"+columnNames.length+";columns:"+arrColumns.length,null,null);
    int len=0;
    columns=new QueryColumnImpl[arrColumns.length];
    if(arrColumns.length>0) {
    // test columns
      len=arrColumns[0].size();
      for(int i=0;i<arrColumns.length;i++) {
        if(arrColumns[i].size()!=len)
          throw new DatabaseException("invalid parameter for query, all columns must have the same size","column[1]:"+len+"<>column["+(i+1)+"]:"+arrColumns[i].size(),null,null);
        //columns[i]=new QueryColumnTypeFlex(arrColumns[i]);
        columns[i]=new QueryColumnImpl(this,columnNames[i],arrColumns[i],Types.OTHER);
      }
    // test keys
      validateColumnNames(columnNames);
View Full Code Here

    if(key.length()>=10) {
          if(key.equals(KeyConstants._RECORDCOUNT)) return new Double(getRecordcount());
          if(key.equals(KeyConstants._CURRENTROW)) return new Double(row);
      if(key.equals(KeyConstants._COLUMNLIST)) return getColumnlist(true);
        }
    throw new DatabaseException("column ["+key+"] not found in query, columns are ["+getColumnlist(false)+"]",null,sql,null);
  }
View Full Code Here

        QueryColumn removed = removeColumnEL(key);
        if(removed==null) {
            if(key.equals(KeyConstants._RECORDCOUNT) ||
                key.equals(KeyConstants._CURRENTROW) ||
                key.equals(KeyConstants._COLUMNLIST))
                throw new DatabaseException("can't remove "+key+" this is not a row","existing rows are ["+getColumnlist(false)+"]",null,null);
            throw new DatabaseException("can't remove row ["+key+"], this row doesn't exist",
                    "existing rows are ["+getColumnlist(false)+"]",null,null);
        }
        return removed;
  }
View Full Code Here

    public Object setAt(Collection.Key key, int row, Object value) throws PageException {
    int index=getIndexFromKey(key);
        if(index!=-1) {
            return columns[index].set(row,value);
        }
        throw new DatabaseException("column ["+key+"] does not exist","columns are ["+getColumnlist(false)+"]",sql,null);
  }
View Full Code Here

TOP

Related Classes of railo.runtime.exp.DatabaseException

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.