aspose file tools*
The moose likes Java in General and the fly likes displaying database records rowwise in the table Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "displaying database records rowwise in the table" Watch "displaying database records rowwise in the table" New topic
Author

displaying database records rowwise in the table

Abhishek Reddy
Ranch Hand

Joined: Mar 28, 2006
Posts: 259
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?


Abhishek
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19543
    
  16

Define table. Is it an HTML table? JTable?


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Jilesh Lakhani
Ranch Hand

Joined: Jul 26, 2006
Posts: 49

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

-Jilesh
Universe and Knowledge has no bounderies
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60056
    
  65

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.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60056
    
  65

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.

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: displaying database records rowwise in the table
 
Similar Threads
How to insert records in ms-access table using jdbc console application.
Writing to an excel sheet from java servlet
javax.servlet.ServletException: java.lang.IndexOutOfBoundsException: Index: 6, Size: 0
SELECT QUERY
Doubt on Servlet having database connection?