Package com.meidusa.amoeba.sqljep

Examples of com.meidusa.amoeba.sqljep.ParseException


    if (param instanceof Timestamp || param instanceof java.sql.Date) {
      java.util.Date ts = (java.util.Date)param;
      cal.setTimeInMillis(ts.getTime());
      return new Integer(cal.get(DATE));
    }
    throw new ParseException(WRONG_TYPE+" day("+param.getClass()+")");
  }
View Full Code Here


      cal.add(SECOND, s);
      cal.add(MINUTE, m);
      cal.roll(HOUR_OF_DAY, h);
      return (param1 instanceof Time) ? new Time(cal.getTimeInMillis()) : new Timestamp(cal.getTimeInMillis());
    } else {
      throw new ParseException(WRONG_TYPE+"  addtime("+param1.getClass()+","+param2.getClass()+")");
    }
  }
View Full Code Here

      if (dayOfWeek == 0) {
        dayOfWeek = 7;
      }
      return new Integer(dayOfWeek);
    }
    throw new ParseException(WRONG_TYPE+" dayofweek("+param.getClass()+")");
  }
View Full Code Here

      Comparable<?>  param1 = runtime.stack.pop();
      return new Comparable<?>[]{param1,param2,param3};
    } else {
      // remove all parameters from stack and push null
      removeParams(runtime.stack, num);
      throw new ParseException(PARAMS_NUMBER+" for substr");
    }
  }
View Full Code Here

    }
    try {
      int beginIndex = getInteger(param2)-1;
      return param1.toString().substring(beginIndex);
    } catch (ParseException e) {
      throw new ParseException(PARAM_EXCEPTION);
    } catch (StringIndexOutOfBoundsException e) {
      return null;
    }
  }
View Full Code Here

      if (beginIndex < 0) {
        beginIndex += source.length()+1;
      }
      return source.substring(beginIndex,beginIndex+count);
    } catch (ParseException e) {
      throw new ParseException(PARAM_EXCEPTION);
    } catch (StringIndexOutOfBoundsException e) {
      return null;
    }
  }
View Full Code Here

          BigDecimal b2 = new BigDecimal(l2);
          return b1.multiply(b2);
        }
      }
    } else {
      throw new ParseException(WRONG_TYPE+"  ("+param1.getClass()+"*"+param2.getClass()+")");
    }
  }
 
View Full Code Here

            if(!runtime.isMultValue){
              break;
            }
          }
        } else {
          throw new ParseException("In case only boolean is possible as condition. Found: "+(cond != null ? cond.getClass() : "NULL"));
        }
      }
      if (count <= 0 && elseCase) {
        result.add(num-1);
      }
      if (result.size() > 0) {
        Comparable<?>[] comparables = new Comparable[result.size()];
        int j=0;
        for(int i:result){
          node.jjtGetChild(i).jjtAccept(runtime.ev, null);
          Comparable<?>  variant = runtime.stack.pop();
          comparables[j] = variant;
          j++;
        }
        //runtime.stack.push(variant);
        return comparables;
      } else {
        //runtime.stack.push(null);
        return new Comparable<?>[]{""};
      }
    } else {
      throw new ParseException("Few arguments for case");
    }
  }
View Full Code Here

          long thisVal = n1.longValue();
          long anotherVal = n2.longValue();
          return (thisVal<anotherVal ? -1 : (thisVal==anotherVal ? 0 : 1));
        }
      }
      throw new ParseException("Not comparable");
    }
  }
View Full Code Here

    if (param instanceof Timestamp || param instanceof java.sql.Time) {
      java.util.Date ts = (java.util.Date)param;
      cal.setTimeInMillis(ts.getTime());
      return new Integer(cal.get(HOUR_OF_DAY));
    }
    throw new ParseException(WRONG_TYPE+" hour("+param.getClass()+")");
  }
View Full Code Here

TOP

Related Classes of com.meidusa.amoeba.sqljep.ParseException

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.