Package railo.runtime.exp

Examples of railo.runtime.exp.DatabaseException


    //disconnectCache();
        // TODO Meta type
    content=(Array) Duplicator.duplicate(content,false);
   
     if(getIndexFromKey(columnName)!=-1)
       throw new DatabaseException("column name ["+columnName.getString()+"] already exist",null,sql,null);
     if(content.size()!=getRecordcount()) {
       //throw new DatabaseException("array for the new column has not the same size like the query (arrayLen!=query.recordcount)");
       if(content.size()>getRecordcount()) addRow(content.size()-getRecordcount());
       else content.setEL(getRecordcount(),"");
     }
View Full Code Here


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

    }

 
  private static void checkSQLRestriction(DatasourceConnection dc, String keyword, Array sqlparts, SQL sql) throws PageException {
        if(ArrayFind.find(sqlparts,keyword,false)>0) {
            throw new DatabaseException("access denied to execute \""+StringUtil.ucFirst(keyword)+"\" SQL statement for datasource "+dc.getDatasource().getName(),null,sql,dc);
        }
    }
View Full Code Here

    return recs;
  }

  public static void removeRows(Query query, int index, int count) throws PageException {
    if(query.getRecordcount()==0)
      throw new DatabaseException("cannot remove rows, query is empty",null,null,null);
    if(index<0 || index>=query.getRecordcount())
      throw new DatabaseException("invalid index ["+index+"], index must be between 0 and "+(query.getRecordcount()-1),null,null,null);
    if(index+count>query.getRecordcount())
      throw new DatabaseException("invalid count ["+count+"], count+index ["+(count+index)+"] must less or equal to "+(query.getRecordcount()),null,null,null);
   
    for(int row=count;row>=1;row--){
      query.removeRow(index+row);
    }
  }
View Full Code Here

      if(strAction.equals("begin")) action=ACTION_BEGIN;
        else if(strAction.equals("commit")) action=ACTION_COMMIT;
        else if(strAction.equals("rollback")) action=ACTION_ROLLBACK;
        else if(strAction.equals("setsavepoint")) action=ACTION_SET_SAVEPOINT;
        else {
            throw new DatabaseException("attribute action has an invalid value, valid values are [begin,commit,setsavepoint and rollback]",null,null,null);
        }
     
     
    }
View Full Code Here

        if(isolation.equals("read_uncommitted"))    this.isolation=Connection.TRANSACTION_READ_UNCOMMITTED;
        else if(isolation.equals("read_committed")) this.isolation=Connection.TRANSACTION_READ_COMMITTED;
        else if(isolation.equals("repeatable_read"))this.isolation=Connection.TRANSACTION_REPEATABLE_READ;
        else if(isolation.equals("serializable"))   this.isolation=Connection.TRANSACTION_SERIALIZABLE;
        else if(isolation.equals("none"))           this.isolation=Connection.TRANSACTION_NONE;
        else throw new DatabaseException("transaction has an invalid isolation level (attribute isolation, valid values are [read_uncommitted,read_committed,repeatable_read,serializable])",null,null,null);
    }
View Full Code Here

        contractTo(params,index+1);
       
        //if(res!=null)print.out(new QueryImpl(res,"columns").toString());
      }
      catch (SQLException e) {
          throw new DatabaseException(e,dc);
      }
     
     
    }
   
View Full Code Here

      }
       
       
    }
    catch (SQLException e) {
        throw new DatabaseException(e,new SQLImpl(sql.toString()),dc);
    }
    finally {
        if(callStat!=null){
          try {
          callStat.close();
View Full Code Here

 
  private Object check(Object value) throws PageException {
        if(maxlength!=-1) {
            String str = Caster.toString(value);
            if(str.length()>maxlength)
                throw new DatabaseException("value ["+value+"] is to large, defined maxlength is ["+Caster.toString(maxlength)+"] but length of value is ["+str.length()+"]",null,null,null);
        }
      return value;
  }
View Full Code Here

          columns.add((Column) _selects[i]);
       
      }
      return columns.toArray(new Column[columns.size()]);
    }
    throw new DatabaseException("not supported for Union distinct",null,null,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.