File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes Reseltset to JSP page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Reseltset to JSP page" Watch "Reseltset to JSP page" New topic
Author

Reseltset to JSP page

jay Rotti
Greenhorn

Joined: Apr 05, 2001
Posts: 9
Hi,
I have a Java Beans which gets result set object. For simplicity I am getting same resultset object to JSP page. I know this is costly affair with connection being open.
I need simple and clean solution to replace this logic.
I have 100 records with 10 columns each.
I know bit about hashtabel, arraylist But I don't know how to store rows and columns and how to fetch them back.
any help appreciated.
thanks
SoonAnn Lim
Ranch Hand

Joined: Jun 21, 2001
Posts: 155
You may have to do some homework before find the solution. You need to know how a data structure works before you can discuss the logical solution for a particular problem. I will suggest you take a look at any reputable java tutorial books. I guarantee you will find plenty information about the characteristic and implementation of data structures. Wish you good luck.
subramaniam vaidyanathan
Greenhorn

Joined: Jun 25, 2001
Posts: 10
Hi,
One of the simple ways is to store the resultset data in a vector of hashtables.. i.e each entry in the vector (hashtable) represents a row.. the entries in the hashtable itself are a key value pair of the form column_name = column_value... I hope you see the picture.. i guess you would be doing the database operations in a servlet or bean.. now you attach this vector to the request object as an attribute and forward it to the jsp page.. you can retreive it and dispaly on the jsp..
However there certainly might be better ways to do all this such as maybe a HashMap etc.. but then thats for you to find out..
Subbu
Originally posted by jay Rotti:
Hi,
I have a Java Beans which gets result set object. For simplicity I am getting same resultset object to JSP page. I know this is costly affair with connection being open.
I need simple and clean solution to replace this logic.
I have 100 records with 10 columns each.
I know bit about hashtabel, arraylist But I don't know how to store rows and columns and how to fetch them back.
any help appreciated.
thanks


[This message has been edited by subramaniam vaidyanathan (edited June 25, 2001).]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Reseltset to JSP page
 
Similar Threads
Submitting a lot of textbox in a jsp page
xsl:fo to PDF
Displaying a table in JSP using JSTL tags
JSF, bean and vector
Dynamically rendering JSP page