Iterate ResultSet
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Matthew_Vincent
Posted On:   Tuesday, July 1, 2003 09:58 AM

What is the best architecture to query a database, get the results, and display to the user? I do not need help with the paging logic. I have a view (JSP page) that an end user types a query into a textarea. Let's call it query.jsp. This submits the query to an ActionForm (QueryForm.java) which validates the data. This is then "forwarded" on by the Struts framework to the Action class (QueryAction.java). Currently, the QueryAction class calls another class from which it gets an ArrayList of Strings which contains the names of the columns. The "data" is also retrieved from this class as a 2 dimensional ArrayList. I have no problems of iterating over the columns using the following:    More>>
What is the best architecture to query a database, get the results, and display to the user?


I do not need help with the paging logic.


I have a view (JSP page) that an end user types a query into a textarea. Let's call it query.jsp. This submits the query to an ActionForm (QueryForm.java) which validates the data. This is then "forwarded" on by the Struts framework to the Action class (QueryAction.java). Currently, the QueryAction class calls another class from which it gets an ArrayList of Strings which contains the names of the columns. The "data" is also retrieved from this class as a 2 dimensional ArrayList. I have no problems of iterating over the columns using the following:

			







However, I am having problems iterating over the "rows". Is this the best solution? What other solutions are there? Does anyone have a working example of this? I am getting confused of where the beans should be and how I should be accessing them.


I saw the posting here http://jguru.com/faq/view.jsp?EID=993534, but I wasn't sure of how to set things up (strut-config.xml, etc.)
Thanks for any help you can provide.


Matt

   <<Less

Re: Iterate ResultSet

Posted By:   Matthew_Vincent  
Posted On:   Monday, July 7, 2003 05:35 AM

Found my own answer thanks anyway!
About | Sitemap | Contact