<%! boolean verifyCondition(String cond) {
      // for security we are only accepting conditions
      // in the form of value1 operator value2
      StringTokenizer st = new StringTokenizer(cond, " ");
      if (!((st.countTokens() == 3) || (st.countTokens() == 4))) return false;
      left = st.nextToken();      
      operator = st.nextToken();
      right = st.nextToken();
      if (st.countTokens() == 1 && operator.equalsIgnoreCase("is") 
                                && right.equalsIgnoreCase("not")) {
         operator = operator + " " + right;
         right = st.nextToken();
      }
      if (st.countTokens() == 1 && operator.equalsIgnoreCase("not") 
                                && right.equalsIgnoreCase("like")) {
         operator = operator + " " + right;
         right = st.nextToken();
      }
      if (right.equalsIgnoreCase("null") && (operator.equalsIgnoreCase("is") ||
           operator.equalsIgnoreCase("is not"))) { 
         newCondition = "WHERE " + left + " " + operator + " " + right;
         return true;
      } else 
        if (operator.equals("=") ||
          operator.equals("!=")  ||
          operator.equals(">")   ||
          operator.equals("<")   ||
          operator.equals("<=")  ||
          operator.equals(">=")  ||
          operator.equalsIgnoreCase("is") ||
          operator.equalsIgnoreCase("like") ||
          operator.equalsIgnoreCase("not like")) {
           newCondition = "WHERE " + left + " " + operator + 
             " ? ";
           return true;
      }
      return false;
    }
%>