示例#1
0
 protected void executeQuery(Statement stmt, String q) throws SQLException {
   q = q.replace("$PREFIX", getPrefix());
   LOG.info(" Executing " + q);
   ResultSet rs = stmt.executeQuery(q);
   StringBuilder header = new StringBuilder();
   for (int i = 1; i <= rs.getMetaData().getColumnCount(); i++) {
     if (i > 1) {
       header.append("|");
     }
     header.append(rs.getMetaData().getColumnName(i));
   }
   LOG.info(header);
   int seq = 0;
   while (true) {
     boolean valid = rs.next();
     if (!valid) break;
     seq++;
     StringBuilder line = new StringBuilder();
     for (int i = 1; i <= rs.getMetaData().getColumnCount(); i++) {
       if (i > 1) {
         line.append("|");
       }
       line.append(rs.getString(i));
     }
     LOG.info(seq + ":" + line);
   }
 }
    public String toString() {
      StringBuilder buffer = new StringBuilder();

      buffer.append(_methodName);
      buffer.append("( ");

      if (_argTypes != null) {
        int count = _argTypes.length;

        for (int i = 0; i < count; i++) {
          if (i > 0) {
            buffer.append(", ");
          }

          buffer.append(_argTypes[i].getName());
        }
      }

      buffer.append(" )");

      return buffer.toString();
    }