File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Reseltset to JSP page

 
jay Rotti
Greenhorn
Posts: 9
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 155
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 10
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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).]
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic