Package com.meidusa.amoeba.sqljep

Examples of com.meidusa.amoeba.sqljep.ParseException


    }
    if (param1 instanceof java.util.Date) {
      return (java.util.Date)param1;
    }
    if (!(param1 instanceof String) || !(param2 instanceof String)) {
      throw new ParseException(WRONG_TYPE+"  to_date("+param1.getClass()+","+param2.getClass()+")");
    }
    try {
      OracleTimestampFormat format = new OracleTimestampFormat((String)param2);
      return (java.util.Date)format.parseObject((String)param1);
    } catch (java.text.ParseException e) {
      if (BaseJEP.debug) {
        e.printStackTrace();
      }
      throw new ParseException(e.getMessage());
    }
  }
View Full Code Here


      throws ParseException {
    if(comparables.length == 1){
      if (comparables[0] instanceof String) {
        return (Timestamp.valueOf((String)comparables[0]));
      } else {
        throw new ParseException(FORMAT_EXCEPTION);
      }
    }else{
      return to_date(comparables[0],comparables[1]);
    }
  }
View Full Code Here

      return null;
    }
    if (param instanceof Boolean) {
      return ((Boolean)param).booleanValue() ? Boolean.TRUE : Boolean.FALSE;
    }
    throw new ParseException(WRONG_TYPE+" not "+param.getClass());
  }
View Full Code Here

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

        if (param1 instanceof Timestamp) {
          d = (Timestamp)param1;
          if (param2 instanceof Number) {
            n = (Number)param2;
          } else {
            throw new ParseException(DATE_ADDITION);
          }
          return new Timestamp(d.getTime()-toDay(n));
        }
        else if (param2 instanceof Timestamp) {
          d = (Timestamp)param2;
          if (param1 instanceof Number) {
            n = (Number)param1;
          } else {
            throw new ParseException(DATE_ADDITION);
          }
          return new Timestamp(d.getTime()-toDay(n));
        }
        throw new ParseException(INTERNAL_ERROR);
      }
    } else {
      throw new ParseException(WRONG_TYPE+"  ("+param1.getClass()+"-"+param2.getClass()+")");
    }
  }
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(SECOND));
    }
    throw new ParseException(WRONG_TYPE+" second("+param.getClass()+")");
  }
View Full Code Here

          }
        }
        // runtime.stack.setSize(0);
        return new Comparable<?>[] { (Boolean.FALSE) };
      } else {
        throw new ParseException("Internal error in function IN");
      }
    }
  }
View Full Code Here

        comparables[i] = runtime.stack.pop();
      }
      return comparables;
    } else {
      removeParams(runtime.stack, num);
      throw new ParseException(PARAMS_NUMBER+" for instr");
    }
  }
View Full Code Here

    }
    int beginIndex;
    try {
      beginIndex = getInteger(param3)-1;
    } catch (ParseException e) {
      throw new ParseException(PARAM_EXCEPTION);
    }
    String source = param1.toString();
    if (beginIndex < 0) {
      beginIndex += source.length()+1;
      return new Integer(source.lastIndexOf(param2.toString(), beginIndex)+1);
View Full Code Here

    String source = param1.toString();
    try {
      beginIndex = getInteger(param3)-1;
      number = getInteger(param4);
    } catch (ParseException e) {
      throw new ParseException(PARAM_EXCEPTION);
    }
    if (number < 1) {
      throw new ParseException(OUT_OF_RANGE_EXCEPTION);
    }
    int i = 0;
    if (beginIndex < 0) {
      beginIndex += source.length()+1;
      for (; number > 0 && i >= 0; number--) {
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.