• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Reseltset to JSP page

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 155
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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).]
 
reply
    Bookmark Topic Watch Topic
  • New Topic