public String toString() {
    StringBuffer buf = new StringBuffer("select ");
    if(distinct_) buf.append("distinct ");

    //buf.append(select_.toString());
    int i;
    buf.append(select_.elementAt(0).toString());
    for(i=1; i<select_.size(); i++) {
      buf.append(", " + select_.elementAt(i).toString());
    }

    //buf.append(" from " + from_.toString());
    buf.append(" from ");
    buf.append(from_.elementAt(0).toString());
    for(i=1; i<from_.size(); i++) {
      buf.append(", " + from_.elementAt(i).toString());
    }

    if(where_ != null) {
      buf.append(" where " + where_.toString());
    }
    if(groupby_ != null) {
      buf.append(" " + groupby_.toString());
    }
    if(setclause_ != null) {
      buf.append(" " + setclause_.toString());
    }
    if(orderby_ != null) {
      buf.append(" order by ");
      //buf.append(orderby_.toString());
      buf.append(orderby_.elementAt(0).toString());
      for(i=1; i<orderby_.size(); i++) {
        buf.append(", " + orderby_.elementAt(i).toString());
      }
    }
    if(forupdate_) buf.append(" for update");

    return buf.toString();
  }