Results 1 to 2 of 2

Thread: JSP Resultset not iterating multiple times

Threaded View

  1. #1
    Join Date
    Sep 2010

    JSP Resultset not iterating multiple times


    I'm trying to use JSP resultset.next() multiple times to print HTML tables. However, it doesn't seem to want to work. I can print one or the other fine, but not both. I'm trying something below:

    Resultset rs = null;
    String SQL = "select column1, column2 from table";
    rs = stmtPROD.executeQuery(SQL);

    while(rs.next()) {
    out.println("<tr><td> " + rs.getString("column1") + "</td></tr>");

    while(rs.next()) {
    out.println("<tr><td> " + rs.getString("column2") + "</td></tr>");

    Any tips would be helpful. Thanks!
    Last edited by RunningDude87; 02-10-2014 at 10:36 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center