/**
   * @param out the place to write to
   * @param nr the vector of results
   * @param conn the Connection against which the ResultSet was retrieved
   * @param indentLevel number of tab stops to indent line
   * @exception SQLException thrown on access error
   */
  private static void DisplayNestedResults(
      PrintWriter out, Vector nr, Connection conn, int indentLevel) throws SQLException {

    if (nr == null) return;

    String b = LocalizedResource.getMessage("UT_JDBCDisplayUtil_16");
    String oldString = "0";

    for (int i = 0; i < nr.size(); i++) {
      LocalizedResource.OutputWriter().println();

      // just too clever to get the extra +s
      String t = Integer.toString(i);
      if (t.length() > oldString.length()) {
        oldString = t;
        b = b + LocalizedResource.getMessage("UT_JDBCDisplayUtil_17");
      }

      LocalizedResource.OutputWriter().println(b);
      LocalizedResource.OutputWriter()
          .println(LocalizedResource.getMessage("UT_Resul0", LocalizedResource.getNumber(i)));
      LocalizedResource.OutputWriter().println(b);
      indent_DisplayResults(out, (ResultSet) nr.elementAt(i), conn, indentLevel, null, null);
    }
  }
  private static void DisplayNestedResults(
      PrintStream out, Vector nr, Connection conn, int indentLevel) throws SQLException {

    if (nr == null) return;

    String s = "+ ResultSet #";
    String b = "++++++++++++++++";
    String oldString = "0";

    for (int i = 0; i < nr.size(); i++) {
      System.out.println();

      // just too clever to get the extra +s
      String t = Integer.toString(i);
      if (t.length() > oldString.length()) {
        oldString = t;
        b = b + "+";
      }

      System.out.println(b);
      System.out.println(s + i + " +");
      System.out.println(b);
      indent_DisplayResults(out, (ResultSet) nr.elementAt(i), conn, indentLevel, null, null);
    }
  }
 /**
  * @param out the place to write to
  * @param rs the <code>ResultSet</code> to display
  * @param conn the connection against which the <code>ResultSet</code> was retrieved
  * @param displayColumns column numbers to display, <code>null</code> if all
  * @param displayColumnWidths column widths, in characters, if <code>displayColumns</code> is
  *     specified
  * @exception SQLException on JDBC access failure
  */
 public static void DisplayResults(
     PrintWriter out,
     ResultSet rs,
     Connection conn,
     int[] displayColumns,
     int[] displayColumnWidths)
     throws SQLException {
   indent_DisplayResults(out, rs, conn, 0, displayColumns, displayColumnWidths);
 }
 private static void indent_DisplayResults(
     PrintWriter out,
     ResultSet rs,
     Connection conn,
     int indentLevel,
     int[] displayColumns,
     int[] displayColumnWidths)
     throws SQLException {
   List resultSets = new ArrayList();
   resultSets.add(rs);
   indent_DisplayResults(out, resultSets, conn, 0, displayColumns, displayColumnWidths);
 }
  private static void indent_DisplayResults(
      PrintStream out,
      Statement stmt,
      Connection conn,
      int indentLevel,
      int[] displayColumns,
      int[] displayColumnWidths)
      throws SQLException {

    checkNotNull(stmt, "Statement");

    ResultSet rs = stmt.getResultSet();
    if (rs != null) {
      indent_DisplayResults(out, rs, conn, indentLevel, displayColumns, displayColumnWidths);
      rs.close(); // let the result set go away
    } else {
      DisplayUpdateCount(out, stmt.getUpdateCount(), indentLevel);
    }

    ShowWarnings(out, stmt);
  } // DisplayResults
 public static void DisplayResults(PrintStream out, ResultSet rs, Connection conn)
     throws SQLException {
   indent_DisplayResults(out, rs, conn, 0, null, null);
 }
 public static void DisplayResults(PrintStream out, Statement stmt, Connection conn)
     throws SQLException {
   indent_DisplayResults(out, stmt, conn, 0, null, null);
 }