• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

displaying database records rowwise in the table

 
Abhishek Reddy
Ranch Hand
Posts: 259
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How to display database records rowwise in the table?

I have a resultset and each record has to be displayed rowwise in the table...

is it possible?
 
Rob Spoor
Sheriff
Pie
Posts: 20494
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Define table. Is it an HTML table? JTable?
 
Jilesh Lakhani
Ranch Hand
Posts: 49
Java Python Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
create a table and inside a while loop ..
while(rs.next()) {
<td>rs.getString(1)</td>
}

you can do something like this.... I may be wrong with HTML syntax but hopefully you can take it forward from here.

check with java.sql.resultset
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64618
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please take the time to choose the correct forum for your posts. This forum is for questions on advanced Java. Not only is this not an advanced question, it's not a general Java question. For more information, please read this.

Assuming that you meant an HTML table, this post has been moved to a more appropriate forum.

 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64618
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A resultset should never get anywhere near the UI or a JSP.

Capture the data from the resultset in an appropriate Java collection and close the resultset as soon as possible. Pass the collection back to the controller for sending to the JSP for display.

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic